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

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

Issue 10942028: Support class and typedef literals as expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add a test for literals. Created 8 years, 2 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/compiler.dart
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index 4d587cbccf17751bb32b95de3f3d8e7f06412087..1f7643a0f1bf4d067ac60501f3856ae5c78d6dc7 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -127,6 +127,7 @@ abstract class Compiler implements DiagnosticListener {
ClassElement functionClass;
ClassElement nullClass;
ClassElement listClass;
+ ClassElement typeClass;
ClassElement mapClass;
Element assertMethod;
Element identicalFunction;
@@ -185,9 +186,23 @@ abstract class Compiler implements DiagnosticListener {
static const SourceString START_ROOT_ISOLATE =
const SourceString('startRootIsolate');
bool enabledNoSuchMethod = false;
- bool enabledRuntimeType = false;
bool enabledFunctionApply = false;
+ bool _enabledRuntimeType = false;
ngeoffray 2012/10/31 10:33:03 Why private? I'd prefer to have it consistent with
karlklose 2012/10/31 13:01:18 I have a change to implement the runtime cache to
+ bool _needsRuntimeTypeCache = false;
+
+ void enableRuntimeTypeFunction() {
+ _enabledRuntimeType = true;
+ enableRuntimeTypeCache();
+ }
+
+ void enableRuntimeTypeCache() {
+ _needsRuntimeTypeCache = true;
+ }
+
+ bool get enabledRuntimeType => _enabledRuntimeType;
+ bool needsRuntimeTypeCache() => _needsRuntimeTypeCache;
+
Stopwatch progress;
static const int PHASE_SCANNING = 0;
@@ -393,6 +408,7 @@ abstract class Compiler implements DiagnosticListener {
stringClass = lookupSpecialClass(const SourceString('String'));
functionClass = lookupSpecialClass(const SourceString('Function'));
listClass = lookupSpecialClass(const SourceString('List'));
+ typeClass = lookupSpecialClass(const SourceString('Type'));
mapClass = lookupSpecialClass(const SourceString('Map'));
closureClass = lookupSpecialClass(const SourceString('Closure'));
dynamicClass = lookupSpecialClass(const SourceString('Dynamic_'));

Powered by Google App Engine
This is Rietveld 408576698