| OLD | NEW |
| 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 'native_testing.dart'; | 5 import 'native_testing.dart'; |
| 6 | 6 |
| 7 // Test to see runtimeType works on native classes and does not use the native | 7 // Test to see runtimeType works on native classes and does not use the native |
| 8 // constructor name. | 8 // constructor name. |
| 9 | 9 |
| 10 @Native("TAGX") | 10 @Native("TAGX") |
| 11 class A {} | 11 class A {} |
| 12 | 12 |
| 13 @Native("TAGY") | 13 @Native("TAGY") |
| 14 class B extends A {} | 14 class B extends A {} |
| 15 | 15 |
| 16 makeA() native; | 16 makeA() native; |
| 17 makeB() native; | 17 makeB() native; |
| 18 | 18 |
| 19 void setup() native """ | 19 void setup() native """ |
| 20 // This code is all inside 'setup' and so not accesible from the global scope. | 20 // This code is all inside 'setup' and so not accessible from the global scope. |
| 21 function inherits(child, parent) { | 21 function inherits(child, parent) { |
| 22 function tmp() {}; | 22 function tmp() {}; |
| 23 tmp.prototype = parent.prototype; | 23 tmp.prototype = parent.prototype; |
| 24 child.prototype = new tmp(); | 24 child.prototype = new tmp(); |
| 25 child.prototype.constructor = child; | 25 child.prototype.constructor = child; |
| 26 } | 26 } |
| 27 | 27 |
| 28 function TAGX(){} | 28 function TAGX(){} |
| 29 function TAGY(){} | 29 function TAGY(){} |
| 30 inherits(TAGY, TAGX); | 30 inherits(TAGY, TAGX); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 58 Expect.notEquals('TAGY', '$bT'); | 58 Expect.notEquals('TAGY', '$bT'); |
| 59 } | 59 } |
| 60 | 60 |
| 61 main() { | 61 main() { |
| 62 nativeTesting(); | 62 nativeTesting(); |
| 63 setup(); | 63 setup(); |
| 64 | 64 |
| 65 testDynamicContext(); | 65 testDynamicContext(); |
| 66 testStaticContext(); | 66 testStaticContext(); |
| 67 } | 67 } |
| OLD | NEW |