| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |