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 // Regression test for a bug that was caused by uninstantiated classes being | 5 // Regression test for a bug that was caused by uninstantiated classes being |
6 // added to emitted classes by runtime-type system. | 6 // added to emitted classes by runtime-type system. |
7 // See my explanation in https://codereview.chromium.org/14018036/. | 7 // See my explanation in https://codereview.chromium.org/14018036/. |
8 // -- ahe | 8 // -- ahe |
9 | 9 |
10 import "dart:_js_helper"; | 10 import "dart:_js_helper"; |
11 | 11 |
12 @Native("A") | 12 @Native("A") |
13 class A { | 13 class A { |
14 // Just making sure the field name is unique. | 14 // Just making sure the field name is unique. |
15 var rti_only_native_test_field; | 15 var rti_only_native_test_field; |
16 } | 16 } |
17 | 17 |
18 typedef fisk(); | 18 typedef fisk(); |
19 | 19 |
20 main() { | 20 main() { |
21 void foo(A x) {} | 21 void foo(A x) {} |
22 var map = { 'a': 0, 'b': main }; | 22 var map = {'a': 0, 'b': main}; |
23 try { | 23 try { |
24 map.values.forEach((x) => x.rti_only_native_test_field); | 24 map.values.forEach((x) => x.rti_only_native_test_field); |
25 } finally { | 25 } finally { |
26 print(main is fisk); | 26 print(main is fisk); |
27 return; | 27 return; |
28 } | 28 } |
29 } | 29 } |
OLD | NEW |