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

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

Issue 1859493002: Replace 'length' with more generic 'extractProperty' operation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/prelink.dart
diff --git a/pkg/analyzer/lib/src/summary/prelink.dart b/pkg/analyzer/lib/src/summary/prelink.dart
index 6b92f993b1fd26b3920730025f3bb8d847716216..ede4239238dabf9812642c36f86a8042c31660ea 100644
--- a/pkg/analyzer/lib/src/summary/prelink.dart
+++ b/pkg/analyzer/lib/src/summary/prelink.dart
@@ -421,24 +421,8 @@ class _Prelinker {
// Prefix references must always point backward.
assert(reference.prefixReference < i);
namespace = prefixNamespaces[reference.prefixReference];
- // If in `a.length` the `a` prefix is a top-level variable or a field,
- // then it must be the `String.length` property reference.
- if (namespace == null && reference.name == 'length') {
- ReferenceKind prefixKind = references[reference.prefixReference].kind;
- if (prefixKind == ReferenceKind.topLevelPropertyAccessor ||
- prefixKind == ReferenceKind.propertyAccessor) {
- references
- .add(new LinkedReferenceBuilder(kind: ReferenceKind.length));
- continue;
- }
- }
- // Anything prefixed with 'unresolved' is unresolved.
- if (references[reference.prefixReference].kind ==
- ReferenceKind.unresolved) {
- namespace = const <String, _Meaning>{};
- }
- // Prefix references must always point to proper prefixes.
- assert(namespace != null);
+ // Expressions like 'a.b.c.d' cannot be prelinked.
+ namespace ??= const <String, _Meaning>{};
}
_Meaning meaning = namespace[reference.name];
if (meaning != null) {

Powered by Google App Engine
This is Rietveld 408576698