OLD | NEW |
1 import 'package:dev_compiler/src/js/js_ast.dart'; | 1 import 'package:dev_compiler/src/js_ast/js_ast.dart'; |
2 import 'package:test/test.dart'; | 2 import 'package:test/test.dart'; |
3 | 3 |
4 final _prenumberedPlaceholders = new RegExp(r'#\d+'); | 4 final _prenumberedPlaceholders = new RegExp(r'#\d+'); |
5 | 5 |
6 _parser(String src) => | 6 _parser(String src) => |
7 new MiniJsParser(src.replaceAll(_prenumberedPlaceholders, '#')); | 7 new MiniJsParser(src.replaceAll(_prenumberedPlaceholders, '#')); |
8 | 8 |
9 _check(Node node, String expected) => | 9 _check(Node node, String expected) => |
10 expect(node.toString(), 'js_ast `$expected`'); | 10 expect(node.toString(), 'js_ast `$expected`'); |
11 | 11 |
(...skipping 24 matching lines...) Expand all Loading... |
36 '}'); | 36 '}'); |
37 }); | 37 }); |
38 test('parses statements', () { | 38 test('parses statements', () { |
39 _checkStatement('for (let i = 0; i < 10; i++) {\n}\n'); | 39 _checkStatement('for (let i = 0; i < 10; i++) {\n}\n'); |
40 _checkStatement('for (let i = 0, j = 1; i < 10; i++) {\n}\n'); | 40 _checkStatement('for (let i = 0, j = 1; i < 10; i++) {\n}\n'); |
41 _checkStatement('var [x, y = []] = list;\n'); | 41 _checkStatement('var [x, y = []] = list;\n'); |
42 _checkStatement('var {x, y = {x: y}} = obj;\n'); | 42 _checkStatement('var {x, y = {x: y}} = obj;\n'); |
43 }); | 43 }); |
44 }); | 44 }); |
45 } | 45 } |
OLD | NEW |