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

Unified Diff: pkg/compiler/lib/src/compiler.dart

Issue 812523002: Change signature of lookupConstructor to only require a name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fail gracefully on missing default constructors when evaluating constant constructors. Created 5 years, 11 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: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index af29cdeb94325bbba76415894dafb38b5edaf296..30fb026e55380f0e5cc4bc94b4ab0f4d9f581505 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -1352,16 +1352,17 @@ abstract class Compiler implements DiagnosticListener {
symbolConstructor = cls.constructors.head;
} else if (symbolImplementationClass == cls) {
symbolValidatedConstructor = symbolImplementationClass.lookupConstructor(
- symbolValidatedConstructorSelector);
+ symbolValidatedConstructorSelector.name);
} else if (mirrorsUsedClass == cls) {
mirrorsUsedConstructor = cls.constructors.head;
} else if (intClass == cls) {
- intEnvironment = intClass.lookupConstructor(fromEnvironmentSelector);
+ intEnvironment = intClass.lookupConstructor(fromEnvironmentSelector.name);
Johnni Winther 2015/01/08 09:47:44 Do we still need [fromEnvironmentSelector] as a [S
herhut 2015/01/22 10:33:20 Done.
} else if (stringClass == cls) {
stringEnvironment =
- stringClass.lookupConstructor(fromEnvironmentSelector);
+ stringClass.lookupConstructor(fromEnvironmentSelector.name);
} else if (boolClass == cls) {
- boolEnvironment = boolClass.lookupConstructor(fromEnvironmentSelector);
+ boolEnvironment =
+ boolClass.lookupConstructor(fromEnvironmentSelector.name);
}
}
@@ -1398,19 +1399,13 @@ abstract class Compiler implements DiagnosticListener {
Element _unnamedListConstructor;
Element get unnamedListConstructor {
if (_unnamedListConstructor != null) return _unnamedListConstructor;
- Selector callConstructor = new Selector.callConstructor(
- "", listClass.library);
- return _unnamedListConstructor =
- listClass.lookupConstructor(callConstructor);
+ return _unnamedListConstructor = listClass.lookupDefaultConstructor();
}
Element _filledListConstructor;
Element get filledListConstructor {
if (_filledListConstructor != null) return _filledListConstructor;
- Selector callConstructor = new Selector.callConstructor(
- "filled", listClass.library);
- return _filledListConstructor =
- listClass.lookupConstructor(callConstructor);
+ return _filledListConstructor = listClass.lookupConstructor("filled");
}
/**

Powered by Google App Engine
This is Rietveld 408576698