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'; |
+ } |
+} |