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

Unified Diff: pkg/analyzer/lib/src/summary/summarize_const_expr.dart

Issue 1636113002: Serialize static constant field references. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/analyzer/lib/src/summary/summarize_const_expr.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
index 9305cfbebfad883c1428d39337a8683da1afdb07..f9931c816579e56b6b8cdeb6b16f1dcb884ee108 100644
--- a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
@@ -92,9 +92,14 @@ abstract class AbstractConstExprSerializer {
operations.add(UnlinkedConstOperation.conditional);
} else if (expr is PrefixExpression) {
_serializePrefixExpression(expr);
- } else if (expr is PropertyAccess && expr.propertyName.name == 'length') {
- serialize(expr.target);
- operations.add(UnlinkedConstOperation.length);
+ } else if (expr is PropertyAccess) {
+ if (expr.propertyName.name == 'length') {
+ serialize(expr.target);
Paul Berry 2016/01/26 20:52:49 There's two ambiguities with `length` that I think
scheglov 2016/01/26 21:02:29 I added TODO and will fix it soon.
+ operations.add(UnlinkedConstOperation.length);
+ } else {
+ references.add(serializePropertyAccess(expr));
+ operations.add(UnlinkedConstOperation.pushReference);
+ }
} else if (expr is ParenthesizedExpression) {
serialize(expr.expression);
} else {
@@ -108,6 +113,11 @@ abstract class AbstractConstExprSerializer {
EntityRefBuilder serializeIdentifier(Identifier identifier);
/**
+ * Return [EntityRefBuilder] that corresponds to the given [access].
+ */
+ EntityRefBuilder serializePropertyAccess(PropertyAccess access);
+
+ /**
* Return [EntityRefBuilder] that corresponds to the given [type].
*/
EntityRefBuilder serializeType(TypeName type);

Powered by Google App Engine
This is Rietveld 408576698