Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Side by Side Diff: tests/compiler/dart2js/js_throw_behavior_test.dart

Issue 1075283002: Add unary arithmetic (+#, -#) to ThrowBehaviorVisitor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/native/js.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/js.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698