Chromium Code Reviews| 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); |