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

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

Issue 2725933006: Reduce use of elements/resolution_types in enqueuer. (Closed)
Patch Set: Updated cf. comment. Created 3 years, 9 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
« no previous file with comments | « tests/compiler/dart2js/analyze_unused_dart2js_test.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 'dart:collection'; 6 import 'dart:collection';
7 7
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import 'package:compiler/src/constants/expressions.dart'; 10 import 'package:compiler/src/constants/expressions.dart';
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 Uri uri = new Uri(scheme: 'source'); 1143 Uri uri = new Uri(scheme: 'source');
1144 MockCompiler compiler = compilerFor(source, uri); 1144 MockCompiler compiler = compilerFor(source, uri);
1145 compiler.diagnosticHandler = createHandler(compiler, source); 1145 compiler.diagnosticHandler = createHandler(compiler, source);
1146 return compiler.run(uri).then((_) { 1146 return compiler.run(uri).then((_) {
1147 return compiler; 1147 return compiler;
1148 }); 1148 });
1149 } 1149 }
1150 1150
1151 checkMemberResolved(compiler, className, memberName) { 1151 checkMemberResolved(compiler, className, memberName) {
1152 ClassElement cls = findElement(compiler, className); 1152 ClassElement cls = findElement(compiler, className);
1153 Element memberElement = cls.lookupLocalMember(memberName); 1153 MemberElement memberElement = cls.lookupLocalMember(memberName);
1154 Expect.isNotNull(memberElement); 1154 Expect.isNotNull(memberElement);
1155 Expect.isTrue(compiler.enqueuer.resolution.hasBeenProcessed(memberElement)); 1155 Expect.isTrue(compiler.resolutionWorldBuilder.isMemberUsed(memberElement));
1156 } 1156 }
1157 1157
1158 testToString() { 1158 testToString() {
1159 final script = r"class C { toString() => 'C'; } main() { '${new C()}'; }"; 1159 final script = r"class C { toString() => 'C'; } main() { '${new C()}'; }";
1160 asyncTest(() => compileScript(script).then((compiler) { 1160 asyncTest(() => compileScript(script).then((compiler) {
1161 checkMemberResolved(compiler, 'C', 'toString'); 1161 checkMemberResolved(compiler, 'C', 'toString');
1162 })); 1162 }));
1163 } 1163 }
1164 1164
1165 operatorName(op, isUnary) { 1165 operatorName(op, isUnary) {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 functionName: 'm'); 1538 functionName: 'm');
1539 check( 1539 check(
1540 ''' 1540 '''
1541 class A { 1541 class A {
1542 m() => () => await - 3; 1542 m() => () => await - 3;
1543 } 1543 }
1544 main() => new A().m(); 1544 main() => new A().m();
1545 ''', 1545 ''',
1546 className: 'A'); 1546 className: 'A');
1547 } 1547 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/analyze_unused_dart2js_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698