Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: tests/compiler/dart2js_native/rti_only_native_test.dart

Issue 383413003: Add @Native(...) annotation for native class names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 class A native "A" { 10 import "dart:_js_helper";
11
12 @Native("A")
13 class A {
11 // Just making sure the field name is unique. 14 // Just making sure the field name is unique.
12 var rti_only_native_test_field; 15 var rti_only_native_test_field;
13 } 16 }
14 17
15 typedef fisk(); 18 typedef fisk();
16 19
17 main() { 20 main() {
18 void foo(A x) {} 21 void foo(A x) {}
19 var map = { 'a': 0, 'b': main }; 22 var map = { 'a': 0, 'b': main };
20 try { 23 try {
21 map.values.forEach((x) => x.rti_only_native_test_field); 24 map.values.forEach((x) => x.rti_only_native_test_field);
22 } finally { 25 } finally {
23 print(main is fisk); 26 print(main is fisk);
24 return; 27 return;
25 } 28 }
26 } 29 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_native/oddly_named_fields_test.dart ('k') | tests/compiler/dart2js_native/runtimetype_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698