Version 0.8.10.10
svn merge -r29786:29787 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
R=kasperl@google.com
Review URL: https://codereview.chromium.org//66373002
git-svn-id: http://dart.googlecode.com/svn/trunk@30104 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/tests/co19/co19-analyzer.status b/tests/co19/co19-analyzer.status
index a2bfdea..08468cf 100644
--- a/tests/co19/co19-analyzer.status
+++ b/tests/co19/co19-analyzer.status
@@ -23,10 +23,6 @@
Language/07_Classes/1_Instance_Methods_A04_t02: MissingStaticWarning
Language/07_Classes/4_Abstract_Instance_Members_A07_t04: MissingStaticWarning
-# TBF: It is a static warning if a class C declares an instance method named n and has a setter named n=.
-Language/07_Classes/1_Instance_Methods_A07_t01: MissingStaticWarning
-Language/07_Classes/1_Instance_Methods_A07_t02: MissingStaticWarning
-
# TBF: Static members should not be accessible via subclasses.
Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A01_t05: MissingStaticWarning
@@ -240,9 +236,6 @@
Language/13_Statements/09_Switch_A02_t04: Fail # Issue 629
-
-
-
# co19 issue 642, The argument type 'int' cannot be assigned to the parameter type 'Iterable'
LibTest/collection/DoubleLinkedQueue/DoubleLinkedQueue_class_A01_t01: Fail, OK
LibTest/collection/ListQueue/ListQueue_class_A01_t01: Fail, OK
@@ -257,6 +250,16 @@
# co19 issue 646, I don't see where Spec requires any warning for boolean conversion
Language/12_Expressions/04_Booleans/1_Boolean_Conversion_A01_t02: MissingStaticWarning
+# co19 issue #652, test is invalid, class "C" is not inherited from "A"
+Language/07_Classes/1_Instance_Methods_A07_t02: MissingStaticWarning, OK
+
+# co19 issue #653, instance method setter with the same name
+Language/07_Classes/3_Setters_A04_t02: StaticWarning, OK
+Language/07_Classes/3_Setters_A04_t03: StaticWarning, OK
+Language/07_Classes/3_Setters_A04_t04: StaticWarning, OK
+
+
+
Language/12_Expressions/15_Method_Invocation/2_Cascaded_Invocation_A01_t19: MissingStaticWarning
Language/12_Expressions/19_Conditional_A01_t14: MissingStaticWarning
Language/12_Expressions/20_Logical_Boolean_Expressions_A01_t10: MissingStaticWarning
diff --git a/tests/compiler/dart2js_native/browser_compat_1_prepatched_test.dart b/tests/compiler/dart2js_native/browser_compat_1_prepatched_test.dart
new file mode 100644
index 0000000..abeb7d6
--- /dev/null
+++ b/tests/compiler/dart2js_native/browser_compat_1_prepatched_test.dart
@@ -0,0 +1,92 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+//import 'dart:_foreign_helper' show JS;
+//import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord;
+
+// Test for dartNativeDispatchHooksTransformer, getTag hook.
+
+class T1A native "T1A" {
+}
+
+class T1B native "T1B" {
+}
+
+class T1C native "T1C" {
+}
+
+makeT1A() native;
+makeT1B() native;
+makeT1C() native;
+
+int getTagCallCount() native;
+
+void setup() native r'''
+function T1A() { } // Normal native class.
+function T1CrazyB() { } // Native class with different constructor name.
+
+var T1fakeA = (function(){
+ function T1A() {} // Native class with adversarial constructor name.
+ return T1A;
+})();
+
+// Make constructors visible on 'window' for prepatching.
+if (typeof window == "undefined") window = {}
+window.T1A = T1A;
+window.T1CrazyB = T1CrazyB;
+
+makeT1A = function(){return new T1A;};
+makeT1B = function(){return new T1CrazyB;};
+makeT1C = function(){return new T1fakeA;};
+
+var getTagCount = 0;
+getTagCallCount = function() { return getTagCount; }
+
+function transformer1(hooks) {
+ var getTag = hooks.getTag;
+
+ function getTagNew(obj) {
+ ++getTagCount;
+
+ // If something looks like a different native type we can check in advance
+ // of the default algorithm.
+ if (obj instanceof T1fakeA) return "T1C";
+
+ var tag = getTag(obj);
+
+ // New constructor names can be mapped here.
+ if (tag == "T1CrazyB") return "T1B";
+
+ return tag;
+ }
+
+ hooks.getTag = getTagNew;
+}
+
+dartNativeDispatchHooksTransformer = [transformer1];
+''';
+
+var inscrutable;
+
+main() {
+ setup();
+ inscrutable = (x) => x;
+
+ var t1a = makeT1A();
+ var t1b = makeT1B();
+ var t1c = makeT1C();
+
+ Expect.equals(true, t1a is T1A, '$t1a is T1A');
+ Expect.equals(true, t1b is T1B, '$t1b is T1B');
+ Expect.equals(true, t1c is T1C, '$t1c is T1C');
+
+ Expect.equals(2, getTagCallCount());
+
+ Expect.equals(true, inscrutable(t1a) is T1A, '$t1a is T1A');
+ Expect.equals(true, inscrutable(t1b) is T1B, '$t1b is T1B');
+ Expect.equals(true, inscrutable(t1c) is T1C, '$t1c is T1C');
+
+ Expect.equals(2, getTagCallCount());
+}
diff --git a/tests/compiler/dart2js_native/browser_compat_1_unpatched_test.dart b/tests/compiler/dart2js_native/browser_compat_1_unpatched_test.dart
new file mode 100644
index 0000000..8db4d43
--- /dev/null
+++ b/tests/compiler/dart2js_native/browser_compat_1_unpatched_test.dart
@@ -0,0 +1,95 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+//import 'dart:_foreign_helper' show JS;
+//import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord;
+
+// Test for dartNativeDispatchHooksTransformer, getTag hook.
+// Same as browser_compat_1_prepatched_test but with prepatching disabled.
+
+class T1A native "T1A" {
+}
+
+class T1B native "T1B" {
+}
+
+class T1C native "T1C" {
+}
+
+makeT1A() native;
+makeT1B() native;
+makeT1C() native;
+
+int getTagCallCount() native;
+
+void setup() native r'''
+function T1A() { } // Normal native class.
+function T1CrazyB() { } // Native class with different constructor name.
+
+var T1fakeA = (function(){
+ function T1A() {} // Native class with adversarial constructor name.
+ return T1A;
+})();
+
+// Make constructors visible on 'window' for prepatching.
+if (typeof window == "undefined") window = {}
+window.T1A = T1A;
+window.T1CrazyB = T1CrazyB;
+
+makeT1A = function(){return new T1A;};
+makeT1B = function(){return new T1CrazyB;};
+makeT1C = function(){return new T1fakeA;};
+
+var getTagCount = 0;
+getTagCallCount = function() { return getTagCount; }
+
+function transformer1(hooks) {
+ var getTag = hooks.getTag;
+
+ function getTagNew(obj) {
+ ++getTagCount;
+
+ // If something looks like a different native type we can check in advance
+ // of the default algorithm.
+ if (obj instanceof T1fakeA) return "T1C";
+
+ var tag = getTag(obj);
+
+ // New constructor names can be mapped here.
+ if (tag == "T1CrazyB") return "T1B";
+
+ return tag;
+ }
+
+ hooks.getTag = getTagNew;
+ // Disable prepatching.
+ hooks.prototypeForTag = function() { return null; }
+}
+
+dartNativeDispatchHooksTransformer = [transformer1];
+''';
+
+var inscrutable;
+
+main() {
+ setup();
+ inscrutable = (x) => x;
+
+ var t1a = makeT1A();
+ var t1b = makeT1B();
+ var t1c = makeT1C();
+
+ Expect.equals(true, t1a is T1A, '$t1a is T1A');
+ Expect.equals(true, t1b is T1B, '$t1b is T1B');
+ Expect.equals(true, t1c is T1C, '$t1c is T1C');
+
+ Expect.equals(3, getTagCallCount());
+
+ Expect.equals(true, inscrutable(t1a) is T1A, '$t1a is T1A');
+ Expect.equals(true, inscrutable(t1b) is T1B, '$t1b is T1B');
+ Expect.equals(true, inscrutable(t1c) is T1C, '$t1c is T1C');
+
+ Expect.equals(3, getTagCallCount());
+}
diff --git a/tests/compiler/dart2js_native/browser_compat_2_test.dart b/tests/compiler/dart2js_native/browser_compat_2_test.dart
new file mode 100644
index 0000000..297da7c
--- /dev/null
+++ b/tests/compiler/dart2js_native/browser_compat_2_test.dart
@@ -0,0 +1,142 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+// Test for dartNativeDispatchHooksTransformer
+// - uncached, instance, leaf and interior caching modes.
+// - composition of getTag.
+
+class T1A native "T1A" {
+ foo() native;
+}
+
+class T1B native "T1B" {
+ foo() native;
+}
+
+class T1C native "T1C" {
+ foo() native;
+}
+
+class T1D native "T1D" {
+ foo() native;
+}
+
+makeT1A() native;
+makeT1B() native;
+makeT1C() native;
+makeT1D() native;
+
+int getTagCallCount() native;
+void clearTagCallCount() native;
+
+void setup() native r'''
+function T1A() { this.v = "a"; }
+function T1B() { this.v = "b"; }
+function T1C() { this.v = "c"; }
+function T1D() { this.v = "d"; }
+
+// T1B, T1C and T1D extend T1A in the implementation but not the declared types.
+// T1A must not be leaf-cached otherwise we will pick up the interceptor for T1A
+// when looking for the dispatch record for an uncached or not-yet-cached T1B,
+// T1C or T1D.
+T1B.prototype.__proto__ = T1A.prototype;
+T1C.prototype.__proto__ = T1A.prototype;
+T1D.prototype.__proto__ = T1A.prototype;
+
+// All classes share one implementation of native method 'foo'.
+T1A.prototype.foo = function() { return this.v + this.name(); }
+T1A.prototype.name = function() { return "A"; }
+T1B.prototype.name = function() { return "B"; }
+T1C.prototype.name = function() { return "C"; }
+T1D.prototype.name = function() { return "D"; }
+
+makeT1A = function(){return new T1A;};
+makeT1B = function(){return new T1B;};
+makeT1C = function(){return new T1C;};
+makeT1D = function(){return new T1D;};
+
+var getTagCount = 0;
+getTagCallCount = function() { return getTagCount; }
+clearTagCallCount = function() { getTagCount = 0; }
+
+function transformer1(hooks) {
+ var getTag = hooks.getTag;
+
+ function getTagNew(obj) {
+ var tag = getTag(obj);
+ // Dependency to test composition, rename T1D -> Dep -> -T1D.
+ if (tag == "T1D") return "Dep";
+ return tag;
+ }
+
+ hooks.getTag = getTagNew;
+}
+
+function transformer2(hooks) {
+ var getTag = hooks.getTag;
+
+ function getTagNew(obj) {
+ ++getTagCount;
+ var tag = getTag(obj);
+ if (tag == "T1A") return "+T1A"; // Interior cached on prototype
+ if (tag == "T1B") return "~T1B"; // Uncached
+ if (tag == "T1C") return "!T1C"; // Instance cached
+ if (tag == "Dep") return "-T1D"; // Leaf cached on prototype
+ return tag;
+ }
+
+ hooks.getTag = getTagNew;
+}
+
+dartNativeDispatchHooksTransformer = [transformer1, transformer2];
+''';
+
+var inscrutable;
+
+main() {
+ setup();
+ inscrutable = (x) => x;
+
+ var t1a = makeT1A();
+ var t1b = makeT1B();
+ var t1c = makeT1C();
+ var t1d = makeT1D();
+
+ clearTagCallCount();
+ Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
+ Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
+ Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
+ Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
+ Expect.equals(4, getTagCallCount(), '4 fresh instances / types');
+
+ clearTagCallCount();
+ Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
+ Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
+ Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
+ Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
+ Expect.equals(1, getTagCallCount(), '1 = 1 uncached + (3 cached)');
+
+ t1a = makeT1A();
+ t1b = makeT1B();
+ t1c = makeT1C();
+ t1d = makeT1D();
+
+ clearTagCallCount();
+ Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
+ Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
+ Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
+ Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
+ Expect.equals(2, getTagCallCount(),
+ '2 = 1 fresh instance + 1 uncached (+ 2 proto cached)');
+
+ clearTagCallCount();
+ Expect.equals("aA", inscrutable(t1a).foo(), 't1a is T1A');
+ Expect.equals("bB", inscrutable(t1b).foo(), 't1b is T1B');
+ Expect.equals("cC", inscrutable(t1c).foo(), 't1c is T1C');
+ Expect.equals("dD", inscrutable(t1d).foo(), 't1d is T1D');
+ Expect.equals(1, getTagCallCount(),
+ '1 = 2 proto cached + 1 instance cached + 1 uncached');
+}
diff --git a/tests/language/language_analyzer.status b/tests/language/language_analyzer.status
index ccf8527..e5498ee 100644
--- a/tests/language/language_analyzer.status
+++ b/tests/language/language_analyzer.status
@@ -18,7 +18,6 @@
# TBF: we should check conflicts not only for methods, but for accessors too
override_field_test/03: fail
method_override7_test/03: Fail # Issue 11496
-method_override8_test/03: Fail # Issue 11496
# Please add new failing tests before this line.
# Section below is for invalid tests.
@@ -149,6 +148,11 @@
# test issue 14410, "typedef C = " is now really illegal syntax
mixin_illegal_syntax_test/none: fail
+# test issue 14736, It is a static warning if a class C declares an instance method named n and has a setter named n=.
+setter4_test: StaticWarning
+
+
+
abstract_exact_selector_test: StaticWarning
abstract_getter_test: StaticWarning
diff --git a/tools/VERSION b/tools/VERSION
index e046834..fc8997f 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
MAJOR 0
MINOR 8
BUILD 10
-PATCH 9
+PATCH 10