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

Side by Side Diff: tests/compiler/dart2js/js_parser_statements_test.dart

Issue 750323003: Remove js.ArrayElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add parsing and testing of array holes, make lists non-growable Created 6 years 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
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 testStatement('function foo(#){}', [['x', 'y']], 'function foo(x, y) {\n}'), 193 testStatement('function foo(#){}', [['x', 'y']], 'function foo(x, y) {\n}'),
194 testStatement('function foo(#a){}', {'a': new jsAst.Parameter('x')}, 194 testStatement('function foo(#a){}', {'a': new jsAst.Parameter('x')},
195 'function foo(x) {\n}'), 195 'function foo(x) {\n}'),
196 testStatement('function foo(#a){}', {'a': 'x'}, 'function foo(x) {\n}'), 196 testStatement('function foo(#a){}', {'a': 'x'}, 'function foo(x) {\n}'),
197 testStatement('function foo(#a){}', {'a': []}, 'function foo() {\n}'), 197 testStatement('function foo(#a){}', {'a': []}, 'function foo() {\n}'),
198 testStatement('function foo(#a){}', {'a': ['x']}, 'function foo(x) {\n}'), 198 testStatement('function foo(#a){}', {'a': ['x']}, 'function foo(x) {\n}'),
199 testStatement('function foo(#a){}', 199 testStatement('function foo(#a){}',
200 {'a': ['x', 'y']}, 200 {'a': ['x', 'y']},
201 'function foo(x, y) {\n}'), 201 'function foo(x, y) {\n}'),
202 202
203
204 testStatement('a = #.#', [eVar,eOne], 'a = x[1];'), 203 testStatement('a = #.#', [eVar,eOne], 'a = x[1];'),
205 testStatement('a = #.#', [eVar,'foo'], 'a = x.foo;'), 204 testStatement('a = #.#', [eVar,'foo'], 'a = x.foo;'),
206 testStatement('a = #a.#b', {'a': eVar, 'b': eOne}, 'a = x[1];'), 205 testStatement('a = #a.#b', {'a': eVar, 'b': eOne}, 'a = x[1];'),
207 testStatement('a = #a.#b', {'a': eVar, 'b': 'foo'}, 'a = x.foo;'), 206 testStatement('a = #a.#b', {'a': eVar, 'b': 'foo'}, 'a = x.foo;'),
208 207
209 testStatement('function f(#) { return #.#; }', ['x', eVar,'foo'], 208 testStatement('function f(#) { return #.#; }', ['x', eVar,'foo'],
210 'function f(x) {\n return x.foo;\n}'), 209 'function f(x) {\n return x.foo;\n}'),
211 testStatement('function f(#a) { return #b.#c; }', 210 testStatement('function f(#a) { return #b.#c; }',
212 {'a': 'x', 'b': eVar, 'c': 'foo'}, 211 {'a': 'x', 'b': eVar, 'c': 'foo'},
213 'function f(x) {\n return x.foo;\n}'), 212 'function f(x) {\n return x.foo;\n}'),
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 testStatement('#a.prototype.#a = function(#b) { return #c.#c };', 255 testStatement('#a.prototype.#a = function(#b) { return #c.#c };',
257 {'a': 'name1_2', 256 {'a': 'name1_2',
258 'b': ['r', 'y'], 257 'b': ['r', 'y'],
259 'c': 'name4_5'}, 258 'c': 'name4_5'},
260 'name1_2.prototype.name1_2 = function(r, y) {\n' 259 'name1_2.prototype.name1_2 = function(r, y) {\n'
261 ' return name4_5.name4_5;\n' 260 ' return name4_5.name4_5;\n'
262 '};'), 261 '};'),
263 262
264 ])); 263 ]));
265 } 264 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698