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

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

Issue 694353007: Move dart2js from sdk/lib/_internal/compiler to pkg/compiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 'dart:async'; 5 import 'dart:async';
6 import 'package:expect/expect.dart'; 6 import 'package:expect/expect.dart';
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'mock_compiler.dart'; 8 import 'mock_compiler.dart';
9 import 'package:compiler/implementation/js/js.dart' as jsAst; 9 import 'package:compiler/src/js/js.dart' as jsAst;
10 import 'package:compiler/implementation/js/js.dart' show js; 10 import 'package:compiler/src/js/js.dart' show js;
11 11
12 Future testExpression(String expression, [String expect = ""]) { 12 Future testExpression(String expression, [String expect = ""]) {
13 jsAst.Node node = js(expression); 13 jsAst.Node node = js(expression);
14 return MockCompiler.create((MockCompiler compiler) { 14 return MockCompiler.create((MockCompiler compiler) {
15 String jsText = 15 String jsText =
16 jsAst.prettyPrint(node, 16 jsAst.prettyPrint(node,
17 compiler, 17 compiler,
18 allowVariableMinification: false).getText(); 18 allowVariableMinification: false).getText();
19 if (expect == "") { 19 if (expect == "") {
20 Expect.stringEquals(expression, jsText); 20 Expect.stringEquals(expression, jsText);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 testExpression("y = a == null ? b + c : a + c"), 185 testExpression("y = a == null ? b + c : a + c"),
186 testExpression("foo = a ? b : c ? d : e"), 186 testExpression("foo = a ? b : c ? d : e"),
187 testExpression("foo = a ? b ? c : d : e"), 187 testExpression("foo = a ? b ? c : d : e"),
188 testExpression("foo = (a = v) ? b = w : c = x ? d = y : e = z"), 188 testExpression("foo = (a = v) ? b = w : c = x ? d = y : e = z"),
189 testExpression("foo = (a = v) ? b = w ? c = x : d = y : e = z"), 189 testExpression("foo = (a = v) ? b = w ? c = x : d = y : e = z"),
190 // Stacked assignment. 190 // Stacked assignment.
191 testExpression("a = b = c"), 191 testExpression("a = b = c"),
192 testExpression("var a = b = c"), 192 testExpression("var a = b = c"),
193 ])); 193 ]));
194 } 194 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/js_parser_statements_test.dart ('k') | tests/compiler/dart2js/js_spec_string_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698