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

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

Issue 2033383002: Handle use of fromEnvironment from serialized data. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes Created 4 years, 6 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/compiler.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/elements/common.dart
diff --git a/pkg/compiler/lib/src/elements/common.dart b/pkg/compiler/lib/src/elements/common.dart
index 3786967a2f6dd475f7c0d1c0bf5571ef0cf347b0..0020393f7e616ae6d80de1292a0ac38bfc788bf8 100644
--- a/pkg/compiler/lib/src/elements/common.dart
+++ b/pkg/compiler/lib/src/elements/common.dart
@@ -6,7 +6,7 @@
library elements.common;
-import '../common/names.dart' show Names, Uris;
+import '../common/names.dart' show Identifiers, Names, Uris;
import '../core_types.dart' show CoreClasses;
import '../dart_types.dart' show DartType, InterfaceType, FunctionType;
import '../util/util.dart' show Link;
@@ -607,3 +607,35 @@ abstract class AbstractFieldElementCommon implements AbstractFieldElement {
setter != null && setter.isAbstract;
}
}
+
+abstract class ConstructorElementCommon implements ConstructorElement {
+ @override
+ bool get isFromEnvironmentConstructor {
+ return name == Identifiers.fromEnvironment &&
Siggi Cherem (dart-lang) 2016/06/03 17:57:03 would it be worth caching the results of this?
Johnni Winther 2016/06/13 07:49:20 Made a CL for it.
+ library.isDartCore &&
+ (enclosingClass.name == 'bool' ||
+ enclosingClass.name == 'int' ||
+ enclosingClass.name == 'String');
+ }
+
+ @override
+ bool get isIntFromEnvironmentConstructor {
+ return name == Identifiers.fromEnvironment &&
+ library.isDartCore &&
+ enclosingClass.name == 'int';
+ }
+
+ @override
+ bool get isBoolFromEnvironmentConstructor {
+ return name == Identifiers.fromEnvironment &&
+ library.isDartCore &&
+ enclosingClass.name == 'bool';
+ }
+
+ @override
+ bool get isStringFromEnvironmentConstructor {
+ return name == Identifiers.fromEnvironment &&
+ library.isDartCore &&
+ enclosingClass.name == 'String';
+ }
+}
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698