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

Unified Diff: tests/compiler/dart2js/js_parser_statements_test.dart

Issue 932053002: Support for interpolated declarations in the js parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review Created 5 years, 10 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 | « pkg/compiler/lib/src/js/template.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 38ccd1c27e2df69a0d5513db44f52a922299da30..e9bc2e1b6e37b2794c90affc148b52b6a4334c46 100644
--- a/tests/compiler/dart2js/js_parser_statements_test.dart
+++ b/tests/compiler/dart2js/js_parser_statements_test.dart
@@ -325,5 +325,25 @@ switch (true) {
testStatement('label: while (a) { label2: break label;}', [],
'label:\n while (a) {\n label2:\n break label;\n }'),
+
+ testStatement('var # = 3', ['x'], 'var x = 3;'),
+ testStatement('var # = 3',
+ [new jsAst.VariableDeclaration('x')],
+ 'var x = 3;'),
+ testStatement('var # = 3, # = #',
+ ['x', 'y', js.number(2)],
+ 'var x = 3, y = 2;'),
+ testStatement('var #a = 3, #b = #c',
+ {"a": 'x', "b": 'y', "c": js.number(2)},
+ 'var x = 3, y = 2;'),
+ testStatement('function #() {}', ['x'], 'function x() {\n}'),
+ testStatement('function #() {}',
+ [new jsAst.VariableDeclaration('x')],
+ 'function x() {\n}'),
+ testStatement('try {} catch (#) {}', ['x'], 'try {\n} catch (x) {\n}'),
+ testStatement('try {} catch (#a) {}', {"a": 'x'}, 'try {\n} catch (x) {\n}'),
+ testStatement('try {} catch (#a) {}',
+ {"a": new jsAst.VariableDeclaration('x')},
+ 'try {\n} catch (x) {\n}'),
]));
}
« no previous file with comments | « pkg/compiler/lib/src/js/template.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698