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

Unified Diff: pkg/compiler/lib/src/serialization/constant_serialization.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/serialization/constant_serialization.dart
diff --git a/pkg/compiler/lib/src/serialization/constant_serialization.dart b/pkg/compiler/lib/src/serialization/constant_serialization.dart
index b0413471d19c067789d628ef961057682e25264d..ae3040a2d488840b9a3af31d6eb08379ee4aaf5f 100644
--- a/pkg/compiler/lib/src/serialization/constant_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/constant_serialization.dart
@@ -169,8 +169,8 @@ class ConstantSerializer
@override
void visitDeferred(DeferredConstantExpression exp, ObjectEncoder encoder) {
- throw new UnsupportedError(
- "ConstantSerializer.visitDeferred: ${exp.toDartText()}");
+ encoder.setElement(Key.PREFIX, exp.prefix);
+ encoder.setConstant(Key.EXPRESSION, exp.expression);
}
}
@@ -267,6 +267,9 @@ class ConstantDeserializer {
case ConstantExpressionKind.NAMED_REFERENCE:
return new NamedArgumentReference(decoder.getString(Key.NAME));
case ConstantExpressionKind.DEFERRED:
+ return new DeferredConstantExpression(
+ decoder.getConstant(Key.EXPRESSION),
+ decoder.getElement(Key.PREFIX));
case ConstantExpressionKind.SYNTHETIC:
}
throw new UnsupportedError("Unexpected constant kind: ${kind} in $decoder");

Powered by Google App Engine
This is Rietveld 408576698