Chromium Code Reviews| Index: lib/compiler/implementation/universe/universe.dart |
| diff --git a/lib/compiler/implementation/universe/universe.dart b/lib/compiler/implementation/universe/universe.dart |
| index ef9500b56b45f9cb9801bee93a26fcc0863ec3ab..473d1b645428cb547be73a324521e0a5272cc350 100644 |
| --- a/lib/compiler/implementation/universe/universe.dart |
| +++ b/lib/compiler/implementation/universe/universe.dart |
| @@ -123,6 +123,7 @@ class Selector { |
| final SelectorKind kind; |
| final SourceString name; |
| final LibraryElement library; // Library is null for non-private selectors. |
| + final SourceString normalizedConstructorName; |
|
kasperl
2012/10/08 08:06:41
It would indeed be great to get rid of this and us
aam-me
2012/10/09 04:08:42
Done.
|
| // The numbers of arguments of the selector. Includes named arguments. |
| final int argumentCount; |
| @@ -134,13 +135,15 @@ class Selector { |
| SourceString name, |
| LibraryElement library, |
| this.argumentCount, |
| - [List<SourceString> namedArguments = const <SourceString>[]]) |
| + [List<SourceString> namedArguments = const <SourceString>[], |
| + SourceString normalizedConstructorName = null]) |
| : this.name = name, |
| this.library = name.isPrivate() ? library : null, |
| this.namedArguments = namedArguments, |
| this.orderedNamedArguments = namedArguments.isEmpty() |
| ? namedArguments |
| - : <SourceString>[] { |
| + : <SourceString>[], |
| + this.normalizedConstructorName = normalizedConstructorName { |
| assert(!name.isPrivate() || library != null); |
| } |
| @@ -187,6 +190,20 @@ class Selector { |
| : this(SelectorKind.CALL, Compiler.CALL_OPERATOR_NAME, null, |
| selector.argumentCount, selector.namedArguments); |
| + Selector.callConstructor(SourceString className, |
| + SourceString constructorName, |
| + LibraryElement library) |
| + : this(SelectorKind.CALL, |
| + constructorName, |
| + library, |
| + 0, |
| + const [], |
| + Elements.constructConstructorName(className, constructorName)); |
| + |
| + Selector.callDefaultConstructor(SourceString name, |
| + LibraryElement library) |
| + : this(SelectorKind.CALL, name, library, 0, const [], name); |
| + |
| // TODO(kasperl): This belongs somewhere else. |
| Selector.noSuchMethod() |
| : this(SelectorKind.CALL, Compiler.NO_SUCH_METHOD, null, 2); |