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

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

Issue 1937223002: All initializer expressions are serialized, even if not all of them are constants. (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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_ast_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 23fecd5a870969b0679f97d818123bcc2434c8e7..159b3316372f730190d466a7ca7b433647c998b3 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -286,9 +286,6 @@ class _ConstExprBuilder {
Expression get expr => stack.single;
Expression build() {
- if (!uc.isValidConst) {
- return AstFactory.identifier3(r'$$invalidConstExpr$$');
- }
for (UnlinkedConstOperation operation in uc.operations) {
switch (operation) {
case UnlinkedConstOperation.pushNull:
@@ -564,12 +561,12 @@ class _ConstExprBuilder {
void _pushExtractProperty() {
Expression target = _pop();
String name = uc.strings[stringPtr++];
- // TODO(scheglov) Only String.length property access is supported.
- assert(name == 'length');
- _push(AstFactory.propertyAccess(
- target,
- AstFactory.identifier3('length')
- ..staticElement = _getStringLengthElement()));
+ SimpleIdentifier propertyNode = AstFactory.identifier3(name);
+ // Only String.length property access can be potentially resolved.
+ if (name == 'length') {
+ propertyNode.staticElement = _getStringLengthElement();
+ }
+ _push(AstFactory.propertyAccess(target, propertyNode));
}
void _pushInstanceCreation() {
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698