Chromium Code Reviews| Index: tests/compiler/dart2js/js_parser_test.dart |
| diff --git a/tests/compiler/dart2js/js_parser_test.dart b/tests/compiler/dart2js/js_parser_test.dart |
| index a5f923b989edb2057a08d63ccba4d5c9fd47028f..badd0bd0526e732872dddee3ca35874b939e831b 100644 |
| --- a/tests/compiler/dart2js/js_parser_test.dart |
| +++ b/tests/compiler/dart2js/js_parser_test.dart |
| @@ -10,12 +10,15 @@ import 'package:compiler/src/js/js.dart' as jsAst; |
| import 'package:compiler/src/js/js.dart' show js; |
| Future testExpression(String expression, [String expect = ""]) { |
| + print("About to parse $expression"); |
|
floitsch
2014/12/01 13:03:29
Remove debug prints.
sigurdm
2014/12/02 09:27:31
Done.
|
| jsAst.Node node = js(expression); |
| + print(""); |
| return MockCompiler.create((MockCompiler compiler) { |
| String jsText = |
| jsAst.prettyPrint(node, |
| compiler, |
| allowVariableMinification: false).getText(); |
| + print("got '$jsText'"); |
| if (expect == "") { |
| Expect.stringEquals(expression, jsText); |
| } else { |
| @@ -174,11 +177,13 @@ void main() { |
| testExpression("[]"), |
| testError("[42 42]"), |
| testExpression('beebop([1, 2, 3])'), |
| - // *We can't parse array literals with holes in them. |
| - testError("[1,, 2]"), |
| - testError("[1,]"), |
| - testError("[,]"), |
| - testError("[, 42]"), |
| + // Array literals with holes in them. |
| + testExpression("[1,, 2]"), |
| + testExpression("[1,]", "[1]"), |
| + testExpression("[1,,]", "[1,,]"), |
| + testExpression("[,]"), |
| + testExpression("[,,]"), |
| + testExpression("[, 42]"), |
| // Ternary operator. |
| testExpression("x = a ? b : c"), |
| testExpression("y = a == null ? b : a"), |