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..cbcb6d2604037815de6311541801c19e6144e60c 100644 |
| --- a/lib/compiler/implementation/elements/elements.dart |
| +++ b/lib/compiler/implementation/elements/elements.dart |
| @@ -1275,7 +1275,8 @@ class ClassElement extends ScopeContainerElement |
| } |
| } |
| - Element lookupConstructor(SourceString className, |
| + Element lookupConstructor(LibraryElement fromLibrary, |
|
kasperl
2012/09/19 05:59:17
In general, I think we should start using selector
|
| + SourceString className, |
| [SourceString constructorName = |
| const SourceString(''), |
| Element noMatch(Element)]) { |
| @@ -1289,7 +1290,10 @@ class ClassElement extends ScopeContainerElement |
| normalizedName = className; |
| } |
| Element result = localLookup(normalizedName); |
| - if (result === null || !result.isConstructor()) { |
| + if (result === null |
| + || !result.isConstructor() |
| + || (constructorName.isPrivate() |
| + && result.getLibrary() != fromLibrary)) { |
| result = noMatch !== null ? noMatch(result) : null; |
| } |
| return result; |