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

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

Issue 1718013002: In summaries, don't drop unsafe prefixes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index b702630a3d3a658d1960f32583c3bf8dd9ccc8f9..4f6eb205f2ac629ad52d793f599b6748cd9dd37e 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -440,9 +440,20 @@ class _ConstExprBuilder {
case UnlinkedConstOperation.pushReference:
EntityRef ref = uc.references[refPtr++];
_ReferenceInfo info = resynthesizer.referenceInfos[ref.reference];
- SimpleIdentifier node = AstFactory.identifier3(info.name);
- node.staticElement = info.element;
- _push(node);
+ if (info.enclosing != null &&
+ info.enclosing.element != null &&
+ info.enclosing.element is! ClassElement) {
+ SimpleIdentifier prefix = AstFactory.identifier3(
+ info.enclosing.name)..staticElement = info.enclosing.element;
+ SimpleIdentifier name = AstFactory.identifier3(info.name)
+ ..staticElement = info.element;
+ PrefixedIdentifier node = AstFactory.identifier(prefix, name);
+ _push(node);
+ } else {
+ SimpleIdentifier node = AstFactory.identifier3(info.name);
+ node.staticElement = info.element;
+ _push(node);
+ }
break;
case UnlinkedConstOperation.invokeConstructor:
_pushInstanceCreation();
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698