| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |