| 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 // JavaScript reserved words: | 7 // JavaScript reserved words: |
| 8 // | 8 // |
| 9 // break | 9 // break |
| 10 // case | 10 // case |
| (...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 if (object.yieldValue == null) | 1374 if (object.yieldValue == null) |
| 1375 throw 'incorrect initialization of "yieldValue"'; | 1375 throw 'incorrect initialization of "yieldValue"'; |
| 1376 object.yieldValue = true; | 1376 object.yieldValue = true; |
| 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() { |
| 1385 function NativeClassWithOddNames() {} | 1385 JS('', r""" |
| 1386 makeNativeClassWithOddNames = function() { return new NativeClassWithOddNames; } | 1386 (function(){ |
| 1387 self.nativeConstructor(NativeClassWithOddNames); | 1387 function NativeClassWithOddNames() {} |
| 1388 """; | 1388 makeNativeClassWithOddNames = function() {return new NativeClassWithOddNames()
}; |
| 1389 self.nativeConstructor(NativeClassWithOddNames); |
| 1390 })()"""); |
| 1391 } |
| 1389 | 1392 |
| 1390 main() { | 1393 main() { |
| 1391 nativeTesting(); | 1394 nativeTesting(); |
| 1392 setup(); | 1395 setup(); |
| 1393 var object = makeNativeClassWithOddNames(); | 1396 var object = makeNativeClassWithOddNames(); |
| 1394 object.testMyFields(); | 1397 object.testMyFields(); |
| 1395 testObjectStronglyTyped(object); | 1398 testObjectStronglyTyped(object); |
| 1396 testObjectWeaklyTyped([object]); | 1399 testObjectWeaklyTyped([object]); |
| 1397 testObjectWeaklyTyped(['fisk']); | 1400 testObjectWeaklyTyped(['fisk']); |
| 1398 testObjectWeaklyTyped([new ClassWithOddNames()..testMyFields()]); | 1401 testObjectWeaklyTyped([new ClassWithOddNames()..testMyFields()]); |
| 1399 } | 1402 } |
| OLD | NEW |