OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Test that we put native names and not Dart names into the dynamic | 5 // Test that we put native names and not Dart names into the dynamic |
6 // dispatch table. | 6 // dispatch table. |
7 | 7 |
8 @native("*NativeA") | 8 @native("*NativeA") |
9 class A { | 9 class A { |
10 @native foo(); | 10 @native foo(); |
11 } | 11 } |
12 | 12 |
13 @native("*NativeB") | 13 @native("*NativeB") |
14 class B extends A { | 14 class B extends A { |
15 } | 15 } |
16 | 16 |
17 @native A makeA() { return new A(); } | 17 @native A makeA() { return new A(); } |
18 @native B makeB() { return new B(); } | 18 @native B makeB() { return new B(); } |
19 | 19 |
(...skipping 25 matching lines...) Expand all Loading... |
45 var a = makeA(); | 45 var a = makeA(); |
46 Expect.equals(42, a.foo()); | 46 Expect.equals(42, a.foo()); |
47 A aa = a; | 47 A aa = a; |
48 Expect.equals(42, aa.foo()); | 48 Expect.equals(42, aa.foo()); |
49 | 49 |
50 var b = makeB(); | 50 var b = makeB(); |
51 Expect.equals(42, b.foo()); | 51 Expect.equals(42, b.foo()); |
52 B bb = b; | 52 B bb = b; |
53 Expect.equals(42, bb.foo()); | 53 Expect.equals(42, bb.foo()); |
54 } | 54 } |
OLD | NEW |