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

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

Issue 1942763002: Rebased and retested version of CL 1915123008. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/mock_compiler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/resolver_test.dart
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index 6067a6c499c69632bef43662aff5cb91a8da0d1b..2e1868a804fa7a5e1487becd01f106384d70a68f 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -222,10 +222,11 @@ Future testSuperCalls() {
ClassElement classA = compiler.mainApp.find("A");
FunctionElement fooA = classA.lookupLocalMember("foo");
- ResolverVisitor visitor =
- new ResolverVisitor(compiler, fooB,
- new ResolutionRegistry(compiler,
- new CollectingTreeElements(fooB)));
+ ResolverVisitor visitor = new ResolverVisitor(
+ compiler,
+ fooB,
+ new ResolutionRegistry(compiler, new CollectingTreeElements(fooB)),
+ scope: new MockTypeVariablesScope(classB.buildScope()));
FunctionExpression node =
(fooB as FunctionElementX).parseNode(compiler.parsingContext);
visitor.visit(node.body);
@@ -266,10 +267,12 @@ Future testThis() {
compiler.resolveStatement("Foo foo;");
ClassElement fooElement = compiler.mainApp.find("Foo");
FunctionElement funElement = fooElement.lookupLocalMember("foo");
- ResolverVisitor visitor =
- new ResolverVisitor(compiler, funElement,
- new ResolutionRegistry(compiler,
- new CollectingTreeElements(funElement)));
+ ResolverVisitor visitor = new ResolverVisitor(
+ compiler,
+ funElement,
+ new ResolutionRegistry(
+ compiler, new CollectingTreeElements(funElement)),
+ scope: new MockTypeVariablesScope(fooElement.buildScope()));
FunctionExpression function =
(funElement as FunctionElementX).parseNode(compiler.parsingContext);
visitor.visit(function.body);
@@ -292,9 +295,12 @@ Future testThis() {
compiler.resolveStatement("Foo foo;");
ClassElement fooElement = compiler.mainApp.find("Foo");
FunctionElement funElement = fooElement.lookupLocalMember("foo");
- ResolverVisitor visitor = new ResolverVisitor(compiler, funElement,
- new ResolutionRegistry(compiler,
- new CollectingTreeElements(funElement)));
+ ResolverVisitor visitor = new ResolverVisitor(
+ compiler,
+ funElement,
+ new ResolutionRegistry(
+ compiler, new CollectingTreeElements(funElement)),
+ scope: new MockTypeVariablesScope(fooElement.buildScope()));
FunctionExpression function =
(funElement as FunctionElementX).parseNode(compiler.parsingContext);
visitor.visit(function.body);
@@ -581,10 +587,10 @@ Future testOneInterface() {
// correctly.
compiler.parseScript("abstract class Bar {}");
- ResolverVisitor visitor =
- new ResolverVisitor(compiler, null,
- new ResolutionRegistry(compiler,
- new CollectingTreeElements(null)));
+ ResolverVisitor visitor = new ResolverVisitor(
+ compiler,
+ null,
+ new ResolutionRegistry(compiler, new CollectingTreeElements(null)));
compiler.resolveStatement("Foo bar;");
ClassElement fooElement = compiler.mainApp.find('Foo');
@@ -619,7 +625,6 @@ Future testTwoInterfaces() {
Future testFunctionExpression() {
return MockCompiler.create((MockCompiler compiler) {
- ResolverVisitor visitor = compiler.resolverVisitor();
Map mapping = compiler.resolveStatement("int f() {}").map;
Expect.equals(2, mapping.length);
Element element;
@@ -701,10 +706,11 @@ Future resolveConstructor(
Element element;
element = classElement.lookupConstructor(constructor);
FunctionExpression tree = (element as FunctionElement).node;
- ResolverVisitor visitor =
- new ResolverVisitor(compiler, element,
- new ResolutionRegistry(compiler,
- new CollectingTreeElements(element)));
+ ResolverVisitor visitor = new ResolverVisitor(
+ compiler,
+ element,
+ new ResolutionRegistry(compiler, new CollectingTreeElements(element)),
+ scope: classElement.buildScope());
new InitializerResolver(visitor, element, tree).resolveInitializers();
visitor.visit(tree.body);
Expect.equals(expectedElementCount, map(visitor).length,
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698