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

Side by Side Diff: tests/compiler/dart2js_native/abstract_class_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 "dart:_js_helper";
5 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
6 7
7 // Native classes can have subclasses that are not declared to the program. The 8 // Native classes can have subclasses that are not declared to the program. The
8 // subclasses are indistinguishable from the base class. This means that 9 // subclasses are indistinguishable from the base class. This means that
9 // abstract native classes can appear to have instances. 10 // abstract native classes can appear to have instances.
10 11
11 abstract class A native "A" { 12 @Native("A")
13 abstract class A {
12 } 14 }
13 15
14 abstract class B native "B" { 16 @Native("B")
17 abstract class B {
15 foo() native; 18 foo() native;
16 } 19 }
17 20
18 class C {} 21 class C {}
19 22
20 makeA() native; 23 makeA() native;
21 makeB() native; 24 makeB() native;
22 25
23 void setup() native """ 26 void setup() native """
24 // This code is all inside 'setup' and so not accesible from the global scope. 27 // This code is all inside 'setup' and so not accesible from the global scope.
(...skipping 21 matching lines...) Expand all
46 Expect.isFalse(a is B); 49 Expect.isFalse(a is B);
47 Expect.isTrue(b is B); 50 Expect.isTrue(b is B);
48 Expect.isFalse(c is B); 51 Expect.isFalse(c is B);
49 52
50 Expect.isFalse(a is C); 53 Expect.isFalse(a is C);
51 Expect.isFalse(b is C); 54 Expect.isFalse(b is C);
52 Expect.isTrue(c is C); 55 Expect.isTrue(c is C);
53 56
54 Expect.equals('B.foo', b.foo()); 57 Expect.equals('B.foo', b.foo());
55 } 58 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mock_libraries.dart ('k') | tests/compiler/dart2js_native/bound_closure_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698