| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import 'dart:_foreign_helper' show JS; | 6 import 'dart:_foreign_helper' show JS; |
| 7 import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord; | 7 import 'dart:_js_helper' show Native, Creates, setNativeSubclassDispatchRecord; |
| 8 import 'dart:_interceptors' show | 8 import 'dart:_interceptors' show |
| 9 findInterceptorForType, findConstructorForNativeSubclassType; | 9 findInterceptorForType, findConstructorForNativeSubclassType; |
| 10 | 10 |
| 11 // Test for fields with same name as native fields. We expect N.foo to have the | 11 // Test for fields with same name as native fields. We expect N.foo to have the |
| 12 // property name 'foo' and A.foo and B.foo to have non-conflicting names. | 12 // property name 'foo' and A.foo and B.foo to have non-conflicting names. |
| 13 | 13 |
| 14 class N native "N" { | 14 @Native("N") |
| 15 class N { |
| 15 var foo; | 16 var foo; |
| 16 N.init(); | 17 N.init(); |
| 17 } | 18 } |
| 18 | 19 |
| 19 class A extends N { | 20 class A extends N { |
| 20 var foo = 222; | 21 var foo = 222; |
| 21 A.init() : super.init(); | 22 A.init() : super.init(); |
| 22 Nfoo() => super.foo; // TODO(sra): Fix compiler assert. | 23 Nfoo() => super.foo; // TODO(sra): Fix compiler assert. |
| 23 } | 24 } |
| 24 | 25 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 print(b); | 61 print(b); |
| 61 | 62 |
| 62 Expect.equals(333, inscrutable(b).Bfoo()); | 63 Expect.equals(333, inscrutable(b).Bfoo()); |
| 63 Expect.equals(222, inscrutable(b).Afoo()); | 64 Expect.equals(222, inscrutable(b).Afoo()); |
| 64 Expect.equals(111, inscrutable(b).Nfoo()); | 65 Expect.equals(111, inscrutable(b).Nfoo()); |
| 65 | 66 |
| 66 Expect.equals(333, b.Bfoo()); | 67 Expect.equals(333, b.Bfoo()); |
| 67 Expect.equals(222, b.Afoo()); | 68 Expect.equals(222, b.Afoo()); |
| 68 Expect.equals(111, b.Nfoo()); | 69 Expect.equals(111, b.Nfoo()); |
| 69 } | 70 } |
| OLD | NEW |