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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/js/template.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 'dart:async'; 5 import 'dart:async';
6 import 'package:expect/expect.dart'; 6 import 'package:expect/expect.dart';
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'mock_compiler.dart'; 8 import 'mock_compiler.dart';
9 import 'package:compiler/src/js/js.dart' as jsAst; 9 import 'package:compiler/src/js/js.dart' as jsAst;
10 import 'package:compiler/src/js/js.dart' show js; 10 import 'package:compiler/src/js/js.dart' show js;
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 {'a': 'name1_2', 318 {'a': 'name1_2',
319 'b': ['r', 'y'], 319 'b': ['r', 'y'],
320 'c': 'name4_5'}, 320 'c': 'name4_5'},
321 'name1_2.prototype.name1_2 = function(r, y) {\n' 321 'name1_2.prototype.name1_2 = function(r, y) {\n'
322 ' return name4_5.name4_5;\n' 322 ' return name4_5.name4_5;\n'
323 '};'), 323 '};'),
324 324
325 testStatement('label: while (a) { label2: break label;}', [], 325 testStatement('label: while (a) { label2: break label;}', [],
326 'label:\n while (a) {\n label2:\n break label;\n }'), 326 'label:\n while (a) {\n label2:\n break label;\n }'),
327 327
328
329 testStatement('var # = 3', ['x'], 'var x = 3;'),
330 testStatement('var # = 3',
331 [new jsAst.VariableDeclaration('x')],
332 'var x = 3;'),
333 testStatement('var # = 3, # = #',
334 ['x', 'y', js.number(2)],
335 'var x = 3, y = 2;'),
336 testStatement('var #a = 3, #b = #c',
337 {"a": 'x', "b": 'y', "c": js.number(2)},
338 'var x = 3, y = 2;'),
339 testStatement('function #() {}', ['x'], 'function x() {\n}'),
340 testStatement('function #() {}',
341 [new jsAst.VariableDeclaration('x')],
342 'function x() {\n}'),
343 testStatement('try {} catch (#) {}', ['x'], 'try {\n} catch (x) {\n}'),
344 testStatement('try {} catch (#a) {}', {"a": 'x'}, 'try {\n} catch (x) {\n}') ,
345 testStatement('try {} catch (#a) {}',
346 {"a": new jsAst.VariableDeclaration('x')},
347 'try {\n} catch (x) {\n}'),
328 ])); 348 ]));
329 } 349 }
OLDNEW
« 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