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

Unified Diff: lib/compiler/implementation/resolver.dart

Issue 10947024: Made dart2js constructor lookup logic "private"-aware, fixed 4740 bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed indentation. Created 8 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
Index: lib/compiler/implementation/resolver.dart
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart
index 4d48866514c95619f2f715eece5cae4ee62aa3b9..ff83d263582b2d6faa9f288c9081ccba73566ffa 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -89,7 +89,12 @@ class ResolverTask extends CompilerTask {
final SourceString constructorName =
getConstructorName(initializers.head);
final SourceString className = classElement.name;
- return classElement.lookupConstructor(className, constructorName);
+
+ return classElement.lookupConstructor(
+ new Selector.callConstructor(
+ new SelectorName.namedConstructor(className, constructorName),
+ constructor.getLibrary())
+ );
}
return null;
}
@@ -185,7 +190,10 @@ class ResolverTask extends CompilerTask {
} else {
name = constructor.name;
}
- constructor.defaultImplementation = defaultClass.lookupConstructor(name);
+ constructor.defaultImplementation = defaultClass.lookupConstructor(
+ new Selector.callConstructor(
+ new SelectorName.namedClass(name),
+ defaultClass.getLibrary()));
if (constructor.defaultImplementation === null) {
// We failed to find a constructor named either
@@ -592,7 +600,10 @@ class InitializerResolver {
// Lookup constructor and try to match it to the selector.
ResolverTask resolver = visitor.compiler.resolver;
final SourceString className = lookupTarget.name;
- result = lookupTarget.lookupConstructor(className, constructorName);
+ result = lookupTarget.lookupConstructor(
+ new Selector.callConstructor(
+ new SelectorName.namedConstructor(className, constructorName),
+ constructor.getLibrary()));
if (result === null || !result.isGenerativeConstructor()) {
String classNameString = className.slowToString();
String constructorNameString = constructorName.slowToString();
@@ -2604,7 +2615,10 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
Node diagnosticNode,
SourceString constructorName) {
cls.ensureResolved(compiler);
- Element result = cls.lookupConstructor(cls.name, constructorName);
+ Element result = cls.lookupConstructor(
+ new Selector.callConstructor(
+ new SelectorName.namedConstructor(cls.name, constructorName),
+ resolver.enclosingElement.getLibrary()));
if (result === null) {
String fullConstructorName = cls.name.slowToString();
if (constructorName !== const SourceString('')) {

Powered by Google App Engine
This is Rietveld 408576698