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

Unified Diff: tests/compiler/dart2js/patch_test.dart

Issue 1383503002: Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add TODOs. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/parser_helper.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/patch_test.dart
diff --git a/tests/compiler/dart2js/patch_test.dart b/tests/compiler/dart2js/patch_test.dart
index 10c8bca141bb264265f954b2da86abc1367d412b..1422a1a3958d8edb5b823c0315f1db07050ad87d 100644
--- a/tests/compiler/dart2js/patch_test.dart
+++ b/tests/compiler/dart2js/patch_test.dart
@@ -45,7 +45,7 @@ Future<Compiler> applyPatch(String script, String patch,
}
void expectHasBody(compiler, ElementX element) {
- var node = element.parseNode(compiler);
+ var node = element.parseNode(compiler.parsing);
Expect.isNotNull(node, "Element isn't parseable, when a body was expected");
Expect.isNotNull(node.body);
// If the element has a body it is either a Block or a Return statement,
@@ -55,7 +55,7 @@ void expectHasBody(compiler, ElementX element) {
}
void expectHasNoBody(compiler, ElementX element) {
- var node = element.parseNode(compiler);
+ var node = element.parseNode(compiler.parsing);
Expect.isNotNull(node, "Element isn't parseable, when a body was expected");
Expect.isFalse(node.hasBody());
}
@@ -248,7 +248,7 @@ Future testPatchConstructor() async {
""");
var classOrigin = ensure(compiler, "Class", compiler.coreLibrary.find,
expectIsPatched: true);
- classOrigin.ensureResolved(compiler);
+ classOrigin.ensureResolved(compiler.resolution);
var classPatch = ensure(compiler, "Class", compiler.coreLibrary.patch.find,
expectIsPatch: true);
@@ -287,7 +287,7 @@ Future testPatchRedirectingConstructor() async {
""");
var classOrigin = ensure(compiler, "Class", compiler.coreLibrary.find,
expectIsPatched: true);
- classOrigin.ensureResolved(compiler);
+ classOrigin.ensureResolved(compiler.resolution);
var classPatch = ensure(compiler, "Class", compiler.coreLibrary.patch.find,
expectIsPatch: true);
@@ -331,7 +331,7 @@ Future testPatchMember() async {
""");
var container = ensure(compiler, "Class", compiler.coreLibrary.find,
expectIsPatched: true);
- container.parseNode(compiler);
+ container.parseNode(compiler.parsing);
ensure(compiler, "Class", compiler.coreLibrary.patch.find,
expectIsPatch: true);
@@ -360,7 +360,7 @@ Future testPatchGetter() async {
""");
var container = ensure(compiler, "Class", compiler.coreLibrary.find,
expectIsPatched: true);
- container.parseNode(compiler);
+ container.parseNode(compiler.parsing);
ensure(compiler,
"field",
container.lookupLocalMember,
@@ -393,7 +393,7 @@ Future testRegularMember() async {
""");
var container = ensure(compiler, "Class", compiler.coreLibrary.find,
expectIsPatched: true);
- container.parseNode(compiler);
+ container.parseNode(compiler.parsing);
ensure(compiler, "Class", compiler.coreLibrary.patch.find,
expectIsPatch: true);
@@ -421,7 +421,7 @@ Future testGhostMember() async {
""");
var container = ensure(compiler, "Class", compiler.coreLibrary.find,
expectIsPatched: true);
- container.parseNode(compiler);
+ container.parseNode(compiler.parsing);
ensure(compiler, "Class", compiler.coreLibrary.patch.find,
expectIsPatch: true);
@@ -489,8 +489,8 @@ Future testPatchSignatureCheck() async {
""");
var container = ensure(compiler, "Class", compiler.coreLibrary.find,
expectIsPatched: true);
- container.ensureResolved(compiler);
- container.parseNode(compiler);
+ container.ensureResolved(compiler.resolution);
+ container.parseNode(compiler.parsing);
void expect(String methodName, List infos, List errors) {
compiler.clearMessages();
@@ -568,7 +568,7 @@ Future testExternalWithoutImplementationMember() async {
""");
var container = ensure(compiler, "Class", compiler.coreLibrary.find,
expectIsPatched: true);
- container.parseNode(compiler);
+ container.parseNode(compiler.parsing);
compiler.warnings.clear();
compiler.errors.clear();
@@ -629,7 +629,7 @@ Future testPatchNonExistingMember() async {
""");
var container = ensure(compiler, "Class", compiler.coreLibrary.find,
expectIsPatched: true);
- container.parseNode(compiler);
+ container.parseNode(compiler.parsing);
Expect.isTrue(compiler.warnings.isEmpty,
"Unexpected warnings: ${compiler.warnings}");
@@ -712,7 +712,7 @@ Future testPatchNonExternalMember() async {
""");
var container = ensure(compiler, "Class", compiler.coreLibrary.find,
expectIsPatched: true);
- container.parseNode(compiler);
+ container.parseNode(compiler.parsing);
print('testPatchNonExternalMember.errors:${compiler.errors}');
print('testPatchNonExternalMember.warnings:${compiler.warnings}');
@@ -866,7 +866,7 @@ Future testPatchAndSelector() async {
ClassElement cls = ensure(compiler, "A", compiler.coreLibrary.find,
expectIsPatched: true);
- cls.ensureResolved(compiler);
+ cls.ensureResolved(compiler.resolution);
ensure(compiler, "method", cls.patch.lookupLocalMember,
checkHasBody: true, expectIsRegular: true);
@@ -882,7 +882,7 @@ Future testPatchAndSelector() async {
new Selector.call(const PublicName('method'), CallStructure.NO_ARGS);
TypeMask typeMask = new TypeMask.exact(cls, world);
FunctionElement method = cls.implementation.lookupLocalMember('method');
- method.computeType(compiler);
+ method.computeType(compiler.resolution);
Expect.isTrue(selector.applies(method, world));
Expect.isTrue(typeMask.canHit(method, selector, world));
@@ -892,14 +892,14 @@ Future testPatchAndSelector() async {
new Selector.call(const PublicName('clear'), CallStructure.NO_ARGS);
typeMask = new TypeMask.exact(cls, world);
method = cls.lookupLocalMember('clear');
- method.computeType(compiler);
+ method.computeType(compiler.resolution);
Expect.isTrue(selector.applies(method, world));
Expect.isTrue(typeMask.canHit(method, selector, world));
// Check that the declaration method in the declaration class is a target
// for a typed selector on a subclass.
cls = ensure(compiler, "B", compiler.coreLibrary.find);
- cls.ensureResolved(compiler);
+ cls.ensureResolved(compiler.resolution);
typeMask = new TypeMask.exact(cls, world);
Expect.isTrue(selector.applies(method, world));
Expect.isTrue(typeMask.canHit(method, selector, world));
« no previous file with comments | « tests/compiler/dart2js/parser_helper.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698