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 'dart:_js_helper'; |
6 | 6 |
7 // JavaScript reserved words: | 7 // JavaScript reserved words: |
8 // | 8 // |
9 // break | 9 // break |
10 // case | 10 // case |
11 // catch | 11 // catch |
12 // class | 12 // class |
13 // const | 13 // const |
14 // continue | 14 // continue |
15 // debugger | 15 // debugger |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1377 if (!object.yieldValue) throw 'incorrect value in "yieldValue"'; | 1377 if (!object.yieldValue) throw 'incorrect value in "yieldValue"'; |
1378 object.yieldValue = false; | 1378 object.yieldValue = false; |
1379 if (object.yieldValue) throw 'incorrect value in "yieldValue"'; | 1379 if (object.yieldValue) throw 'incorrect value in "yieldValue"'; |
1380 } | 1380 } |
1381 | 1381 |
1382 NativeClassWithOddNames makeNativeClassWithOddNames() native ; | 1382 NativeClassWithOddNames makeNativeClassWithOddNames() native ; |
1383 | 1383 |
1384 setup() native """ | 1384 setup() native """ |
1385 function NativeClassWithOddNames() {} | 1385 function NativeClassWithOddNames() {} |
1386 makeNativeClassWithOddNames = function() { return new NativeClassWithOddNames; } | 1386 makeNativeClassWithOddNames = function() { return new NativeClassWithOddNames; } |
1387 self.nativeConstructor(NativeClassWithOddNames); | |
1388 """; | 1387 """; |
1389 | 1388 |
1390 main() { | 1389 main() { |
1391 nativeTesting(); | |
1392 setup(); | 1390 setup(); |
1393 var object = makeNativeClassWithOddNames(); | 1391 var object = makeNativeClassWithOddNames(); |
1394 object.testMyFields(); | 1392 object.testMyFields(); |
1395 testObjectStronglyTyped(object); | 1393 testObjectStronglyTyped(object); |
1396 testObjectWeaklyTyped([object]); | 1394 testObjectWeaklyTyped([object]); |
1397 testObjectWeaklyTyped(['fisk']); | 1395 testObjectWeaklyTyped(['fisk']); |
1398 testObjectWeaklyTyped([new ClassWithOddNames()..testMyFields()]); | 1396 testObjectWeaklyTyped([new ClassWithOddNames()..testMyFields()]); |
1399 } | 1397 } |
OLD | NEW |