| Index: lib/compiler/implementation/compiler.dart
|
| diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
|
| index 1b68df8719f13412a70e87a49c951672b67cbc8f..af7c95d9a22ff6ddaac7734c6014c5778adc077d 100644
|
| --- a/lib/compiler/implementation/compiler.dart
|
| +++ b/lib/compiler/implementation/compiler.dart
|
| @@ -718,11 +718,7 @@ class Compiler implements DiagnosticListener {
|
| }
|
| progress.reset();
|
| }
|
| - if (work.element.kind.category == ElementCategory.VARIABLE) {
|
| - constantHandler.compileWorkItem(work);
|
| - } else {
|
| - backend.codegen(work);
|
| - }
|
| + backend.codegen(work);
|
| }
|
|
|
| void registerInstantiatedClass(ClassElement cls) {
|
| @@ -756,6 +752,21 @@ class Compiler implements DiagnosticListener {
|
| () => resolver.computeFunctionType(element, signature));
|
| }
|
|
|
| + bool isLazilyInitialized(VariableElement element) {
|
| + Constant initialValue = compileVariable(element);
|
| + return initialValue === null;
|
| + }
|
| +
|
| + /**
|
| + * Compiles compile-time constants. Never returns [:null:].
|
| + * If the initial value is not a compile-time constants reports an error.
|
| + */
|
| + Constant compileConstant(VariableElement element) {
|
| + return withCurrentElement(element, () {
|
| + return constantHandler.compileConstant(element);
|
| + });
|
| + }
|
| +
|
| Constant compileVariable(VariableElement element) {
|
| return withCurrentElement(element, () {
|
| return constantHandler.compileVariable(element);
|
|
|