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

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

Issue 1642483002: Improve 'length' instance property reference encoding. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Improve using 'UnlinkedConstOperation.length'. 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/prelink.dart ('k') | pkg/analyzer/lib/src/summary/summarize_elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 771dac90b84f242de15f7f772218944283e3528c..f6dea26583bf704a8ccfcb335aed436b62cdd1db 100644
--- a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
@@ -93,9 +93,8 @@ abstract class AbstractConstExprSerializer {
} else if (expr is PrefixExpression) {
_serializePrefixExpression(expr);
} else if (expr is PropertyAccess) {
- // TODO(scheglov) solve ambiguity of `a.b.length` where `a` and `b` are
- // identifiers
- if (expr.propertyName.name == 'length') {
+ if (expr.target is! PrefixedIdentifier &&
+ expr.propertyName.name == 'length') {
serialize(expr.target);
operations.add(UnlinkedConstOperation.length);
} else {
@@ -110,6 +109,11 @@ abstract class AbstractConstExprSerializer {
}
/**
+ * Return [EntityRefBuilder] that corresponds to the given [constructor].
+ */
+ EntityRefBuilder serializeConstructorName(ConstructorName constructor);
+
+ /**
* Return [EntityRefBuilder] that corresponds to the given [identifier].
*/
EntityRefBuilder serializeIdentifier(Identifier identifier);
@@ -125,11 +129,6 @@ abstract class AbstractConstExprSerializer {
EntityRefBuilder serializeType(TypeName type);
/**
- * Return [EntityRefBuilder] that corresponds to the given [constructor].
- */
- EntityRefBuilder serializeConstructorName(ConstructorName constructor);
-
- /**
* Return the [UnlinkedConstBuilder] that corresponds to the state of this
* serializer.
*/
« no previous file with comments | « pkg/analyzer/lib/src/summary/prelink.dart ('k') | pkg/analyzer/lib/src/summary/summarize_elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698