Chromium Code Reviews| Index: lib/compiler/implementation/elements/elements.dart |
| diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart |
| index 72e3a9abfe799df7f460665595cecc8af2774902..b7b7f1c865c844e4b010415e3cb4464d9fa715a9 100644 |
| --- a/lib/compiler/implementation/elements/elements.dart |
| +++ b/lib/compiler/implementation/elements/elements.dart |
| @@ -1275,10 +1275,11 @@ class ClassElement extends ScopeContainerElement |
| } |
| } |
| - Element lookupConstructor(SourceString className, |
| - [SourceString constructorName = |
| - const SourceString(''), |
| - Element noMatch(Element)]) { |
| + Element lookupConstructor(Selector selector, [Element noMatch(Element)]) { |
| + SourceString className = selector.selectorName.className; |
|
kasperl
2012/09/21 12:12:06
This makes it look like all you really need is to
aam-me
2012/09/21 12:35:27
Right.
|
| + SourceString constructorName = selector.selectorName.name; |
| + |
| + LibraryElement fromLibrary = selector.library; |
| // TODO(karlklose): have a map from class names to a map of constructors |
| // instead of creating the name here? |
| SourceString normalizedName; |
| @@ -1289,7 +1290,10 @@ class ClassElement extends ScopeContainerElement |
| normalizedName = className; |
| } |
| Element result = localLookup(normalizedName); |
| - if (result === null || !result.isConstructor()) { |
| + if (result === null |
| + || !result.isConstructor() |
| + || (selector.selectorName.isPrivate() |
| + && result.getLibrary() != fromLibrary)) { |
| result = noMatch !== null ? noMatch(result) : null; |
| } |
| return result; |