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

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

Issue 2110323003: Support serialization of loadLibrary (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: dartfmt 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
Index: pkg/compiler/lib/src/elements/modelx.dart
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index 248a9ef96606a9833d5128969d8c265cd8d6ab90..e2588fc24fb1a419e139ce03e57f2399ec836445 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -5,6 +5,7 @@
library elements.modelx;
import '../common.dart';
+import '../common/names.dart' show Identifiers;
import '../common/resolution.dart' show Resolution, ParsingContext;
import '../compiler.dart' show Compiler;
import '../constants/constant_constructors.dart';
@@ -1259,6 +1260,11 @@ class PrefixElementX extends ElementX implements PrefixElement {
return visitor.visitPrefixElement(this, arg);
}
+ @override
+ GetterElement get loadLibrary {
+ return isDeferred ? lookupLocalMember(Identifiers.loadLibrary) : null;
+ }
+
String toString() => '$kind($name)';
}
@@ -2254,7 +2260,7 @@ class DeferredLoaderGetterElementX extends GetterElementX
DeferredLoaderGetterElementX(PrefixElement prefix)
: this.prefix = prefix,
- super("loadLibrary", Modifiers.EMPTY, prefix, false) {
+ super(Identifiers.loadLibrary, Modifiers.EMPTY, prefix, false) {
functionSignature = new FunctionSignatureX(type: new FunctionType(this));
}
@@ -2265,6 +2271,7 @@ class DeferredLoaderGetterElementX extends GetterElementX
bool get isDeferredLoaderGetter => true;
bool get isTopLevel => true;
+
// By having position null, the enclosing elements location is printed in
// error messages.
Token get position => null;
@@ -2275,6 +2282,13 @@ class DeferredLoaderGetterElementX extends GetterElementX
FunctionExpression get node => null;
+ bool get hasResolvedAst => true;
+
+ ResolvedAst get resolvedAst {
+ return new SynthesizedResolvedAst(
+ this, ResolvedAstKind.DEFERRED_LOAD_LIBRARY);
+ }
+
@override
SetterElement get setter => null;
}

Powered by Google App Engine
This is Rietveld 408576698