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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/js_parser_statements_test.dart
diff --git a/tests/compiler/dart2js/js_parser_statements_test.dart b/tests/compiler/dart2js/js_parser_statements_test.dart
index e46d3041ec5f311e6d36725c7e7b24617f224f88..733e4ac28f155a79ade516fcc15e7ef470522350 100644
--- a/tests/compiler/dart2js/js_parser_statements_test.dart
+++ b/tests/compiler/dart2js/js_parser_statements_test.dart
@@ -142,4 +142,13 @@ void main() {
testStatement('function foo(r, #) { return #[r](#) }',
[['a', 'b'], 'g', ['b', 'a']],
'function foo(r, a, b) {\n return g[r](b, a);\n}');
+
+ // Sequence is printed flattened
+ var seq1 = js('1, 2, 3');
+ testStatement('x = #', [seq1], 'x = (1, 2, 3);');
+ testStatement('x = (#, #)', [seq1, seq1], 'x = (1, 2, 3, 1, 2, 3);');
+ testStatement('x = #, #', [seq1, seq1], 'x = (1, 2, 3), 1, 2, 3;');
+ testStatement(
+ 'for (i = 0, j = #, k = 0; ; ++i, ++j, ++k){}', [seq1],
+ 'for (i = 0, j = (1, 2, 3), k = 0;; ++i, ++j, ++k) {\n}');
}
« 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