| 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 "dart:_js_helper"; | 5 import "dart:_js_helper"; |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 //import 'dart:_foreign_helper' show JS; | 7 //import 'dart:_foreign_helper' show JS; |
| 8 //import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord; | 8 //import 'dart:_js_helper' show Creates, setNativeSubclassDispatchRecord; |
| 9 | 9 |
| 10 // Test for dartNativeDispatchHooksTransformer, getTag hook. | 10 // Test for dartNativeDispatchHooksTransformer, getTag hook. |
| 11 // Same as browser_compat_1_prepatched_test but with prepatching disabled. | 11 // Same as browser_compat_1_prepatched_test but with prepatching disabled. |
| 12 | 12 |
| 13 @Native("T1A") | 13 @Native("T1A") |
| 14 class T1A { | 14 class T1A {} |
| 15 } | |
| 16 | 15 |
| 17 @Native("T1B") | 16 @Native("T1B") |
| 18 class T1B { | 17 class T1B {} |
| 19 } | |
| 20 | 18 |
| 21 @Native("T1C") | 19 @Native("T1C") |
| 22 class T1C { | 20 class T1C {} |
| 23 } | |
| 24 | 21 |
| 25 makeT1A() native; | 22 makeT1A() native ; |
| 26 makeT1B() native; | 23 makeT1B() native ; |
| 27 makeT1C() native; | 24 makeT1C() native ; |
| 28 | 25 |
| 29 int getTagCallCount() native; | 26 int getTagCallCount() native ; |
| 30 | 27 |
| 31 void setup() native r''' | 28 void setup() native r''' |
| 32 function T1A() { } // Normal native class. | 29 function T1A() { } // Normal native class. |
| 33 function T1CrazyB() { } // Native class with different constructor name. | 30 function T1CrazyB() { } // Native class with different constructor name. |
| 34 | 31 |
| 35 var T1fakeA = (function(){ | 32 var T1fakeA = (function(){ |
| 36 function T1A() {} // Native class with adversarial constructor name. | 33 function T1A() {} // Native class with adversarial constructor name. |
| 37 return T1A; | 34 return T1A; |
| 38 })(); | 35 })(); |
| 39 | 36 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 Expect.equals(true, t1c is T1C, '$t1c is T1C'); | 87 Expect.equals(true, t1c is T1C, '$t1c is T1C'); |
| 91 | 88 |
| 92 Expect.equals(3, getTagCallCount()); | 89 Expect.equals(3, getTagCallCount()); |
| 93 | 90 |
| 94 Expect.equals(true, inscrutable(t1a) is T1A, '$t1a is T1A'); | 91 Expect.equals(true, inscrutable(t1a) is T1A, '$t1a is T1A'); |
| 95 Expect.equals(true, inscrutable(t1b) is T1B, '$t1b is T1B'); | 92 Expect.equals(true, inscrutable(t1b) is T1B, '$t1b is T1B'); |
| 96 Expect.equals(true, inscrutable(t1c) is T1C, '$t1c is T1C'); | 93 Expect.equals(true, inscrutable(t1c) is T1C, '$t1c is T1C'); |
| 97 | 94 |
| 98 Expect.equals(3, getTagCallCount()); | 95 Expect.equals(3, getTagCallCount()); |
| 99 } | 96 } |
| OLD | NEW |