Index: tests/compiler/dart2js_native/super_call_test.dart |
diff --git a/tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart b/tests/compiler/dart2js_native/super_call_test.dart |
similarity index 70% |
copy from tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart |
copy to tests/compiler/dart2js_native/super_call_test.dart |
index 7177573baa247af0dd8028bda6c33c48d6dd2146..68cccb7b5e74c41afe6d11842d7fc9a4001ced38 100644 |
--- a/tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart |
+++ b/tests/compiler/dart2js_native/super_call_test.dart |
@@ -10,17 +10,21 @@ import "package:expect/expect.dart"; |
// stored on Object.prototype. |
class A native "A" { |
- foo([a=100]) native; |
+ foo() => 'A.foo ${bar()}'; |
+ bar() => 'A.bar'; |
} |
class B extends A native "B" { |
+ bar() => 'B.bar'; |
} |
class C extends B native "C" { |
- foo([z=300]) native; |
+ foo() => 'C.foo; super.foo = ${super.foo()}'; |
+ bar() => 'C.bar'; |
} |
class D extends C native "D" { |
+ bar() => 'D.bar'; |
} |
makeA() native; |
@@ -49,9 +53,6 @@ inherits(C, B); |
function D(){} |
inherits(D, C); |
-A.prototype.foo = function(a){return 'A.foo(' + a + ')';} |
-C.prototype.foo = function(z){return 'C.foo(' + z + ')';} |
- |
makeA = function(){return new A}; |
makeB = function(){return new B}; |
makeC = function(){return new C}; |
@@ -67,14 +68,8 @@ main() { |
var c = makeC(); |
var d = makeD(); |
- Expect.equals('A.foo(100)', b.foo()); |
- Expect.equals('C.foo(300)', d.foo()); |
- // If the above line fails with C.foo(100) then the dispatch to fill in the |
- // default got the wrong one, followed by a second dispatch that resolved to |
- // the correct native method. |
- |
- Expect.equals('A.foo(1)', a.foo(1)); |
- Expect.equals('A.foo(2)', b.foo(2)); |
- Expect.equals('C.foo(3)', c.foo(3)); |
- Expect.equals('C.foo(4)', d.foo(4)); |
+ Expect.equals('A.foo A.bar', a.foo()); |
+ Expect.equals('A.foo B.bar', b.foo()); |
+ Expect.equals('C.foo; super.foo = A.foo C.bar', c.foo()); |
+ Expect.equals('C.foo; super.foo = A.foo D.bar', d.foo()); |
} |