Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Unified Diff: lib/compiler/implementation/universe/universe.dart

Issue 10947024: Made dart2js constructor lookup logic "private"-aware, fixed 4740 bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Another attempt at implementing private-aware constructor lookup logic - with normalized constructo… Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/universe/universe.dart
diff --git a/lib/compiler/implementation/universe/universe.dart b/lib/compiler/implementation/universe/universe.dart
index 645d71b77b5173cfe4910803a83634a1f1891eda..3ba33605c1bfbba86c86c01cd5790d0de925629d 100644
--- a/lib/compiler/implementation/universe/universe.dart
+++ b/lib/compiler/implementation/universe/universe.dart
@@ -123,6 +123,7 @@ class Selector implements Hashable {
final SelectorKind kind;
final SourceString name;
final LibraryElement library; // Library is null for non-private selectors.
+ final SourceString normalizedConstructorName;
// The numbers of arguments of the selector. Includes named arguments.
final int argumentCount;
@@ -134,13 +135,15 @@ class Selector implements Hashable {
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 implements Hashable {
: 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);

Powered by Google App Engine
This is Rietveld 408576698