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

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

Issue 2013883003: Migrate UnlinkedVariable.constExpr to UnlinkedExecutable.bodyExpr. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix a comment Created 4 years, 7 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/link.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.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 14682443fb5167df1b4f91bcd0ad316d72a4d23a..d0d4819279d16e3119a7551da04a7f4c67d77eb5 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -2293,13 +2293,14 @@ class _UnitResynthesizer {
LocalVariableElement buildLocalVariable(UnlinkedVariable serializedVariable,
ExecutableElementImpl enclosingExecutable) {
LocalVariableElementImpl element;
- if (serializedVariable.constExpr != null && serializedVariable.isConst) {
+ if (serializedVariable.initializer?.bodyExpr != null &&
+ serializedVariable.isConst) {
ConstLocalVariableElementImpl constElement =
new ConstLocalVariableElementImpl.forSerialized(
serializedVariable, enclosingExecutable);
element = constElement;
constElement.constantInitializer = _buildConstExpression(
- enclosingExecutable, serializedVariable.constExpr);
+ enclosingExecutable, serializedVariable.initializer.bodyExpr);
} else {
element = new LocalVariableElementImpl.forSerialized(
serializedVariable, enclosingExecutable);
@@ -2611,13 +2612,14 @@ class _UnitResynthesizer {
for (int i = 0; i < numberOfVariables; i++) {
UnlinkedVariable unlinkedVariable = unlinkedVariables[i];
TopLevelVariableElementImpl element;
- if (unlinkedVariable.constExpr != null && unlinkedVariable.isConst) {
+ if (unlinkedVariable.initializer?.bodyExpr != null &&
+ unlinkedVariable.isConst) {
ConstTopLevelVariableElementImpl constElement =
new ConstTopLevelVariableElementImpl.forSerialized(
unlinkedVariable, unit);
element = constElement;
constElement.constantInitializer =
- _buildConstExpression(null, unlinkedVariable.constExpr);
+ _buildConstExpression(null, unlinkedVariable.initializer.bodyExpr);
} else {
element = new TopLevelVariableElementImpl.forSerialized(
unlinkedVariable, unit);
@@ -2647,15 +2649,15 @@ class _UnitResynthesizer {
throw new UnimplementedError('Must be lazy');
} else {
FieldElementImpl element;
- if (serializedVariable.constExpr != null &&
+ if (serializedVariable.initializer?.bodyExpr != null &&
(serializedVariable.isConst ||
serializedVariable.isFinal && !serializedVariable.isStatic)) {
ConstFieldElementImpl constElement =
new ConstFieldElementImpl.forSerialized(
serializedVariable, enclosingClass);
element = constElement;
- constElement.constantInitializer =
- _buildConstExpression(enclosingClass, serializedVariable.constExpr);
+ constElement.constantInitializer = _buildConstExpression(
+ enclosingClass, serializedVariable.initializer.bodyExpr);
} else {
element = new FieldElementImpl.forSerialized(
serializedVariable, enclosingClass);
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698