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 super access from classes that extend native classes. | 11 // Test for super access from classes that extend native classes. |
12 | 12 |
13 class N1 native "N1" { | 13 @Native("N1") |
| 14 class N1 { |
14 } | 15 } |
15 | 16 |
16 class N2 extends N1 native "N2" { | 17 @Native("N2") |
| 18 class N2 extends N1 { |
17 N2.init(); | 19 N2.init(); |
18 String text; | 20 String text; |
19 foo() native; | 21 foo() native; |
20 } | 22 } |
21 | 23 |
22 class AA extends N2 { | 24 class AA extends N2 { |
23 AA.init() : super.init(); | 25 AA.init() : super.init(); |
24 String afield; | 26 String afield; |
25 afun() => 'afun:$afield'; | 27 afun() => 'afun:$afield'; |
26 } | 28 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 127 |
126 main() { | 128 main() { |
127 setup(); | 129 setup(); |
128 inscrutable = (x) => x; | 130 inscrutable = (x) => x; |
129 | 131 |
130 setNativeSubclassDispatchRecord(getBBPrototype(), findInterceptorForType(BB)); | 132 setNativeSubclassDispatchRecord(getBBPrototype(), findInterceptorForType(BB)); |
131 | 133 |
132 testSuperOnNative(); | 134 testSuperOnNative(); |
133 testSuperOnSubclassOfNative(); | 135 testSuperOnSubclassOfNative(); |
134 } | 136 } |
OLD | NEW |