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

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

Issue 2939063002: Strong mode cleaning of many dart2js tests. (Closed)
Patch Set: Use ClassElement. Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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:async_helper/async_helper.dart'; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:expect/expect.dart';
8 import 'compiler_helper.dart'; 7 import 'compiler_helper.dart';
9 8
10 const String TEST_1 = r""" 9 const String TEST_1 = r"""
11 import 'dart:_foreign_helper'; 10 import 'dart:_foreign_helper';
12 main() { 11 main() {
13 JS('', '#.toString()', -5); 12 JS('', '#.toString()', -5);
14 // absent: "5.toString" 13 // absent: "5.toString"
15 // present: "(-5).toString" 14 // present: "(-5).toString"
16 } 15 }
17 """; 16 """;
18 17
19 main() { 18 main() {
20 Future check(String test) { 19 Future check(String test) {
21 Uri uri = new Uri(scheme: 'dart', path: 'test'); 20 Uri uri = new Uri(scheme: 'dart', path: 'test');
22 var compiler = compilerFor(test, uri, expectedErrors: 0); 21 var compiler = compilerFor(test, uri, expectedErrors: 0);
23 return compiler.run(uri).then((_) { 22 return compiler.run(uri).then((_) {
24 var element = findElement(compiler, 'main'); 23 var element = findElement(compiler, 'main');
25 var backend = compiler.backend; 24 var backend = compiler.backend;
26 String generated = backend.getGeneratedCode(element); 25 String generated = backend.getGeneratedCode(element);
27 checkerForAbsentPresent(test)(generated); 26 checkerForAbsentPresent(test)(generated);
28 }); 27 });
29 } 28 }
30 29
31 asyncTest(() => Future.wait([ 30 asyncTest(() => Future.wait([
32 check(TEST_1), 31 check(TEST_1),
33 ])); 32 ]));
34 } 33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698