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

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

Issue 260233003: Remove js.Sequence and use binary comma operator instead. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | « sdk/lib/_internal/compiler/implementation/ssa/codegen.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 'mock_compiler.dart'; 6 import 'mock_compiler.dart';
7 import '../../../sdk/lib/_internal/compiler/implementation/js/js.dart' as jsAst; 7 import '../../../sdk/lib/_internal/compiler/implementation/js/js.dart' as jsAst;
8 import '../../../sdk/lib/_internal/compiler/implementation/js/js.dart' show js; 8 import '../../../sdk/lib/_internal/compiler/implementation/js/js.dart' show js;
9 9
10 10
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 testStatement('#.prototype.# = function(#) { return #.# };', 136 testStatement('#.prototype.# = function(#) { return #.# };',
137 ['className', 'getterName', ['r', 'y'], 'r', 'fieldName'], 137 ['className', 'getterName', ['r', 'y'], 'r', 'fieldName'],
138 'className.prototype.getterName = function(r, y) {\n' 138 'className.prototype.getterName = function(r, y) {\n'
139 ' return r.fieldName;\n' 139 ' return r.fieldName;\n'
140 '};'); 140 '};');
141 141
142 testStatement('function foo(r, #) { return #[r](#) }', 142 testStatement('function foo(r, #) { return #[r](#) }',
143 [['a', 'b'], 'g', ['b', 'a']], 143 [['a', 'b'], 'g', ['b', 'a']],
144 'function foo(r, a, b) {\n return g[r](b, a);\n}'); 144 'function foo(r, a, b) {\n return g[r](b, a);\n}');
145
146 // Sequence is printed flattened
147 var seq1 = js('1, 2, 3');
148 testStatement('x = #', [seq1], 'x = (1, 2, 3);');
149 testStatement('x = (#, #)', [seq1, seq1], 'x = (1, 2, 3, 1, 2, 3);');
150 testStatement('x = #, #', [seq1, seq1], 'x = (1, 2, 3), 1, 2, 3;');
151 testStatement(
152 'for (i = 0, j = #, k = 0; ; ++i, ++j, ++k){}', [seq1],
153 'for (i = 0, j = (1, 2, 3), k = 0;; ++i, ++j, ++k) {\n}');
145 } 154 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698