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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 test('Array', NEVER); | 87 test('Array', NEVER); |
88 test('Object', NEVER); | 88 test('Object', NEVER); |
89 | 89 |
90 test('typeof #', NEVER); | 90 test('typeof #', NEVER); |
91 test('typeof console', NEVER); | 91 test('typeof console', NEVER); |
92 test('typeof foo.#', MAY); | 92 test('typeof foo.#', MAY); |
93 test('typeof #.foo', NULL_NSM); | 93 test('typeof #.foo', NULL_NSM); |
94 | 94 |
95 test('throw 123', MUST); | 95 test('throw 123', MUST); |
96 test('throw #', MUST); | 96 test('throw #', MUST); |
97 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. |
98 test('throw #.x = 123', MUST); | 98 test('throw #.x = 123', MUST); |
99 } | 99 } |
OLD | NEW |