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

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

Issue 13493011: Fix some tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 'mock_compiler.dart'; 6 import 'mock_compiler.dart';
6 import '../../../sdk/lib/_internal/compiler/implementation/js/js.dart' as jsAst; 7 import '../../../sdk/lib/_internal/compiler/implementation/js/js.dart' as jsAst;
7 import '../../../sdk/lib/_internal/compiler/implementation/js/js.dart' show js; 8 import '../../../sdk/lib/_internal/compiler/implementation/js/js.dart' show js;
8 9
9 void testExpression(String expression, [String expect = ""]) { 10 void testExpression(String expression, [String expect = ""]) {
10 jsAst.Node node = js(expression); 11 jsAst.Node node = js(expression);
11 MockCompiler compiler = new MockCompiler(); 12 MockCompiler compiler = new MockCompiler();
12 String jsText = 13 String jsText =
13 jsAst.prettyPrint(node, 14 jsAst.prettyPrint(node,
14 compiler, 15 compiler,
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 testExpression("y = a == null ? b : a"); 148 testExpression("y = a == null ? b : a");
148 testExpression("y = a == null ? b + c : a + c"); 149 testExpression("y = a == null ? b + c : a + c");
149 testExpression("foo = a ? b : c ? d : e"); 150 testExpression("foo = a ? b : c ? d : e");
150 testExpression("foo = a ? b ? c : d : e"); 151 testExpression("foo = a ? b ? c : d : e");
151 testExpression("foo = (a = v) ? b = w : c = x ? d = y : e = z"); 152 testExpression("foo = (a = v) ? b = w : c = x ? d = y : e = z");
152 testExpression("foo = (a = v) ? b = w ? c = x : d = y : e = z"); 153 testExpression("foo = (a = v) ? b = w ? c = x : d = y : e = z");
153 // Stacked assignment. 154 // Stacked assignment.
154 testExpression("a = b = c"); 155 testExpression("a = b = c");
155 testExpression("var a = b = c"); 156 testExpression("var a = b = c");
156 } 157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698