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

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: return null for unresolved default 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
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 19fba4a53261a32e10354a9f31356e208b16d5e8..a74c45baee9f64fc956f56bf25b050437080822a 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -920,6 +920,7 @@ abstract class Compiler implements DiagnosticListener {
static const int NO_SUCH_METHOD_ARG_COUNT = 1;
static const String CREATE_INVOCATION_MIRROR =
'createInvocationMirror';
+ static const String FROM_ENVIRONMENT = 'fromEnvironment';
static const String RUNTIME_TYPE = 'runtimeType';
@@ -936,8 +937,6 @@ abstract class Compiler implements DiagnosticListener {
Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT);
final Selector symbolValidatedConstructorSelector = new Selector.call(
'validated', null, 1);
- final Selector fromEnvironmentSelector = new Selector.callConstructor(
- 'fromEnvironment', null, 2);
bool enabledNoSuchMethod = false;
bool enabledRuntimeType = false;
@@ -1360,16 +1359,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(FROM_ENVIRONMENT);
} else if (stringClass == cls) {
stringEnvironment =
- stringClass.lookupConstructor(fromEnvironmentSelector);
+ stringClass.lookupConstructor(FROM_ENVIRONMENT);
} else if (boolClass == cls) {
- boolEnvironment = boolClass.lookupConstructor(fromEnvironmentSelector);
+ boolEnvironment =
+ boolClass.lookupConstructor(FROM_ENVIRONMENT);
}
}
@@ -1407,19 +1407,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");
}
/**
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698