| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
| 6 import 'package:compiler/src/native/native.dart'; | 6 import 'package:compiler/src/native/native.dart'; |
| 7 import 'package:compiler/src/js/js.dart' as js; | 7 import 'package:compiler/src/js/js.dart' as js; |
| 8 | 8 |
| 9 void test(String source, NativeThrowBehavior expectedThrowBehavior) { | 9 void test(String source, NativeThrowBehavior expectedThrowBehavior) { |
| 10 js.Template template = js.js.parseForeignJS(source); | 10 js.Template template = js.js.parseForeignJS(source); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 test('0', NEVER); | 22 test('0', NEVER); |
| 23 test('void 0', NEVER); | 23 test('void 0', NEVER); |
| 24 test('#', NEVER); | 24 test('#', NEVER); |
| 25 test('void #', NEVER); | 25 test('void #', NEVER); |
| 26 test('# + 1', NEVER); | 26 test('# + 1', NEVER); |
| 27 test('!#', NEVER); | 27 test('!#', NEVER); |
| 28 test('!!#', NEVER); | 28 test('!!#', NEVER); |
| 29 test('~#', NEVER); | 29 test('~#', NEVER); |
| 30 test('~~#', NEVER); | 30 test('~~#', NEVER); |
| 31 test('-#', NEVER); |
| 32 test('+#', NEVER); |
| 33 test('-(-#)', NEVER); |
| 34 test('+#', NEVER); |
| 31 | 35 |
| 32 test('# * #', NEVER); | 36 test('# * #', NEVER); |
| 33 test('# / #', NEVER); | 37 test('# / #', NEVER); |
| 34 test('# % #', NEVER); | 38 test('# % #', NEVER); |
| 35 test('# + #', NEVER); | 39 test('# + #', NEVER); |
| 36 test('# - #', NEVER); | 40 test('# - #', NEVER); |
| 37 | 41 |
| 38 test('# << #', NEVER); | 42 test('# << #', NEVER); |
| 39 test('# >> #', NEVER); | 43 test('# >> #', NEVER); |
| 40 test('# >>> #', NEVER); | 44 test('# >>> #', NEVER); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 test('typeof #', NEVER); | 90 test('typeof #', NEVER); |
| 87 test('typeof console', NEVER); | 91 test('typeof console', NEVER); |
| 88 test('typeof foo.#', MAY); | 92 test('typeof foo.#', MAY); |
| 89 test('typeof #.foo', NULL_NSM); | 93 test('typeof #.foo', NULL_NSM); |
| 90 | 94 |
| 91 test('throw 123', MUST); | 95 test('throw 123', MUST); |
| 92 test('throw #', MUST); | 96 test('throw #', MUST); |
| 93 test('throw #.x', MUST); // Could be better: is also an NSM guard. | 97 test('throw #.x', MUST); // Could be better: is also an NSM guard. |
| 94 test('throw #.x = 123', MUST); | 98 test('throw #.x = 123', MUST); |
| 95 } | 99 } |
| OLD | NEW |