| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 hidden native class names are not used by generated code. | 5 // Test that hidden native class names are not used by generated code. |
| 6 | 6 |
| 7 @native("*B") | 7 @native("*B") |
| 8 class A { | 8 class A { |
| 9 get name => 'A'; | 9 get name => 'A'; |
| 10 static A create() => makeA(); | 10 static A create() => makeA(); |
| 11 } | 11 } |
| 12 | 12 |
| 13 @native("*C") | 13 @native("*C") |
| 14 class B { | 14 class B { |
| 15 get name => 'B'; | 15 get name => 'B'; |
| 16 static B create() => makeB(); | 16 static B create() => makeB(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 class C { // Ordinary class with name clashing with native class. | 19 class C { // Ordinary class with name clashing with native class. |
| 20 get name => 'C'; | 20 get name => 'C'; |
| 21 static C create() => new C(); | 21 static C create() => new C(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 @native makeA(); | 24 @native makeA(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 49 | 49 |
| 50 var things = [A.create(), B.create(), C.create()]; | 50 var things = [A.create(), B.create(), C.create()]; |
| 51 var a = things[inscrutable(0)]; | 51 var a = things[inscrutable(0)]; |
| 52 var b = things[inscrutable(1)]; | 52 var b = things[inscrutable(1)]; |
| 53 var c = things[inscrutable(2)]; | 53 var c = things[inscrutable(2)]; |
| 54 | 54 |
| 55 Expect.equals('A', a.name); | 55 Expect.equals('A', a.name); |
| 56 Expect.equals('B', b.name); | 56 Expect.equals('B', b.name); |
| 57 Expect.equals('C', c.name); | 57 Expect.equals('C', c.name); |
| 58 } | 58 } |
| OLD | NEW |