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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 return compiler.runCompiler(uri).then((_) { | 1076 return compiler.runCompiler(uri).then((_) { |
1077 return compiler; | 1077 return compiler; |
1078 }); | 1078 }); |
1079 } | 1079 } |
1080 | 1080 |
1081 checkMemberResolved(compiler, className, memberName) { | 1081 checkMemberResolved(compiler, className, memberName) { |
1082 ClassElement cls = findElement(compiler, className); | 1082 ClassElement cls = findElement(compiler, className); |
1083 Element memberElement = cls.lookupLocalMember(memberName); | 1083 Element memberElement = cls.lookupLocalMember(memberName); |
1084 Expect.isNotNull(memberElement); | 1084 Expect.isNotNull(memberElement); |
1085 Expect.isTrue( | 1085 Expect.isTrue( |
1086 compiler.enqueuer.resolution.hasBeenProcessed(memberElement)); | 1086 compiler.enqueuer.resolution.hasBeenResolved(memberElement)); |
1087 } | 1087 } |
1088 | 1088 |
1089 testToString() { | 1089 testToString() { |
1090 final script = r"class C { toString() => 'C'; } main() { '${new C()}'; }"; | 1090 final script = r"class C { toString() => 'C'; } main() { '${new C()}'; }"; |
1091 asyncTest(() => compileScript(script).then((compiler) { | 1091 asyncTest(() => compileScript(script).then((compiler) { |
1092 checkMemberResolved(compiler, 'C', 'toString'); | 1092 checkMemberResolved(compiler, 'C', 'toString'); |
1093 })); | 1093 })); |
1094 } | 1094 } |
1095 | 1095 |
1096 operatorName(op, isUnary) { | 1096 operatorName(op, isUnary) { |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 } | 1410 } |
1411 main() => A.m(); | 1411 main() => A.m(); |
1412 ''', functionName: 'm'); | 1412 ''', functionName: 'm'); |
1413 check(''' | 1413 check(''' |
1414 class A { | 1414 class A { |
1415 m() => () => await - 3; | 1415 m() => () => await - 3; |
1416 } | 1416 } |
1417 main() => new A().m(); | 1417 main() => new A().m(); |
1418 ''', className: 'A'); | 1418 ''', className: 'A'); |
1419 } | 1419 } |
OLD | NEW |