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

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: 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 771dac90b84f242de15f7f772218944283e3528c..b238fdf6328f4c6d53ff62df599fe837767b576b 100644
--- a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
@@ -93,9 +93,7 @@ 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 StringLiteral && expr.propertyName.name == 'length') {
Paul Berry 2016/01/27 16:48:59 I think this should be: if (expr.target is! P
scheglov 2016/01/27 17:55:10 Done.
serialize(expr.target);
operations.add(UnlinkedConstOperation.length);
} else {
@@ -110,6 +108,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 +128,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.
*/

Powered by Google App Engine
This is Rietveld 408576698