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 cebff15544db0b379fcb92675f348e861fb6ebf5..9d49db35b70956ee7adcb30e8075630f35493e25 100644 |
| --- a/lib/compiler/implementation/elements/elements.dart |
| +++ b/lib/compiler/implementation/elements/elements.dart |
| @@ -1403,21 +1403,14 @@ abstract class ClassElement extends ScopeContainerElement |
| } |
| } |
| - Element lookupConstructor(SourceString className, |
| - [SourceString constructorName = |
| - const SourceString(''), |
| - Element noMatch(Element)]) { |
| + Element lookupConstructor(Selector selector, [Element noMatch(Element)]) { |
| // TODO(karlklose): have a map from class names to a map of constructors |
| // instead of creating the name here? |
| - SourceString normalizedName; |
| - if (constructorName !== const SourceString('')) { |
| - normalizedName = Elements.constructConstructorName(className, |
| - constructorName); |
| - } else { |
| - normalizedName = className; |
| - } |
| - Element result = localLookup(normalizedName); |
| - if (result === null || !result.isConstructor()) { |
| + Element result = localLookup(selector.normalizedConstructorName); |
|
kasperl
2012/10/08 08:06:41
Can't you construct the normalized constructor nam
aam-me
2012/10/09 04:08:42
Thanks for the tips. I gave it a try.
|
| + if (result === null |
| + || !result.isConstructor() |
| + || (selector.name.isPrivate() |
| + && result.getLibrary() != selector.library)) { |
| result = noMatch !== null ? noMatch(result) : null; |
| } |
| return result; |