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 '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 Loading... | |
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;'), | |
floitsch
2015/02/18 12:28:14
Add tests with "new js.Declaration".
sigurdm
2015/02/18 13:03:09
Done.
| |
330 testStatement('var # = 3, # = #', | |
331 ['x', 'y', js.number(2)], | |
332 'var x = 3, y = 2;'), | |
333 testStatement('var #a = 3, #b = #c', | |
334 {"a": 'x', "b": 'y', "c": js.number(2)}, | |
335 'var x = 3, y = 2;'), | |
336 testStatement('function #() {}', ['x'], 'function x() {\n}'), | |
337 testStatement('try {} catch (#) {}', ['x'], 'try {} catch (x) {}'), | |
338 testStatement('try {} catch (#a) {}', {"a": 'x'}, 'try {} catch (x) {}'), | |
328 ])); | 339 ])); |
329 } | 340 } |
OLD | NEW |