| Index: lib/compiler/implementation/elements/elements.dart
|
| diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
|
| index dc70d0f39b13d28cea2c6ccf8e5451055e4058fe..5ae09393b8676ffe7965d4512737af376ae96625 100644
|
| --- a/lib/compiler/implementation/elements/elements.dart
|
| +++ b/lib/compiler/implementation/elements/elements.dart
|
| @@ -1475,42 +1475,24 @@ abstract class ClassElement extends ScopeContainerElement
|
| }
|
| }
|
|
|
| - Element validateConstructorLookupResults(Selector selector,
|
| - Element result,
|
| - Element noMatch(Element)) {
|
| - if (result === null
|
| - || !result.isConstructor()
|
| - || (selector.name.isPrivate()
|
| - && result.getLibrary() != selector.library)) {
|
| - result = noMatch !== null ? noMatch(result) : null;
|
| - }
|
| - return result;
|
| - }
|
| -
|
| - // TODO(aprelev@gmail.com): Peter believes that it would be great to
|
| - // make noMatch a required argument. Peter's suspicion is that most
|
| - // callers of this method would benefit from using the noMatch method.
|
| - Element lookupConstructor(Selector selector, [Element noMatch(Element)]) {
|
| + Element lookupConstructor(SourceString className,
|
| + [SourceString constructorName =
|
| + const SourceString(''),
|
| + Element noMatch(Element)]) {
|
| + // TODO(karlklose): have a map from class names to a map of constructors
|
| + // instead of creating the name here?
|
| SourceString normalizedName;
|
| - SourceString className = this.name;
|
| - SourceString constructorName = selector.name;
|
| - if (constructorName !== const SourceString('') &&
|
| - ((className === null) ||
|
| - (constructorName.slowToString() != className.slowToString()))) {
|
| + if (constructorName !== const SourceString('')) {
|
| normalizedName = Elements.constructConstructorName(className,
|
| constructorName);
|
| } else {
|
| normalizedName = className;
|
| }
|
| Element result = localLookup(normalizedName);
|
| - return validateConstructorLookupResults(selector, result, noMatch);
|
| - }
|
| -
|
| - Element lookupFactoryConstructor(Selector selector,
|
| - [Element noMatch(Element)]) {
|
| - SourceString constructorName = selector.name;
|
| - Element result = localLookup(constructorName);
|
| - return validateConstructorLookupResults(selector, result, noMatch);
|
| + if (result === null || !result.isConstructor()) {
|
| + result = noMatch !== null ? noMatch(result) : null;
|
| + }
|
| + return result;
|
| }
|
|
|
| bool get hasConstructor {
|
|
|