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

Side by Side Diff: tests/compiler/dart2js_native/subclassing_super_field_1_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 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 shadowed fields in classes that extend native classes. 11 // Test for shadowed fields in classes that extend native classes.
12 12
13 class N native "N" { 13 @Native("N")
14 class N {
14 N.init(); 15 N.init();
15 } 16 }
16 17
17 class A extends N { 18 class A extends N {
18 var foo = 111; 19 var foo = 111;
19 A.init() : super.init(); 20 A.init() : super.init();
20 } 21 }
21 22
22 class B extends A { 23 class B extends A {
23 var foo = 222; 24 var foo = 222;
(...skipping 30 matching lines...) Expand all
54 JS('', '#(#)', constructor, b); 55 JS('', '#(#)', constructor, b);
55 56
56 print(b); 57 print(b);
57 58
58 Expect.equals(222, inscrutable(b).Bfoo()); 59 Expect.equals(222, inscrutable(b).Bfoo());
59 Expect.equals(111, inscrutable(b).Afoo()); 60 Expect.equals(111, inscrutable(b).Afoo());
60 61
61 Expect.equals(222, b.Bfoo()); 62 Expect.equals(222, b.Bfoo());
62 Expect.equals(111, b.Afoo()); 63 Expect.equals(111, b.Afoo());
63 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698