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

Unified Diff: pkg/compiler/lib/src/constants/constructors.dart

Issue 1916053003: Add toStructuredText to ConstantExpression and align method names with ConstantValue (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: dartfmt 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 | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/constants/expressions.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/constants/constructors.dart
diff --git a/pkg/compiler/lib/src/constants/constructors.dart b/pkg/compiler/lib/src/constants/constructors.dart
index b8e747114d3d3ec88f60f3e2b33aa38f93f88b01..c0e09b699f78026b65041158d6914297053b5558 100644
--- a/pkg/compiler/lib/src/constants/constructors.dart
+++ b/pkg/compiler/lib/src/constants/constructors.dart
@@ -99,13 +99,13 @@ class GenerativeConstantConstructor implements ConstantConstructor {
StringBuffer sb = new StringBuffer();
sb.write("{'type': $type");
defaultValues.forEach((key, ConstantExpression expression) {
- sb.write(",\n 'default:${key}': ${expression.getText()}");
+ sb.write(",\n 'default:${key}': ${expression.toDartText()}");
});
fieldMap.forEach((FieldElement field, ConstantExpression expression) {
- sb.write(",\n 'field:${field}': ${expression.getText()}");
+ sb.write(",\n 'field:${field}': ${expression.toDartText()}");
});
if (superConstructorInvocation != null) {
- sb.write(",\n 'constructor: ${superConstructorInvocation.getText()}");
+ sb.write(",\n 'constructor: ${superConstructorInvocation.toDartText()}");
}
sb.write("}");
return sb.toString();
@@ -189,9 +189,9 @@ class RedirectingGenerativeConstantConstructor implements ConstantConstructor {
StringBuffer sb = new StringBuffer();
sb.write("{'type': ${thisConstructorInvocation.type}");
defaultValues.forEach((key, ConstantExpression expression) {
- sb.write(",\n 'default:${key}': ${expression.getText()}");
+ sb.write(",\n 'default:${key}': ${expression.toDartText()}");
});
- sb.write(",\n 'constructor': ${thisConstructorInvocation.getText()}");
+ sb.write(",\n 'constructor': ${thisConstructorInvocation.toDartText()}");
sb.write("}");
return sb.toString();
}
@@ -237,7 +237,7 @@ class RedirectingFactoryConstantConstructor implements ConstantConstructor {
String toString() {
StringBuffer sb = new StringBuffer();
sb.write("{");
- sb.write("'constructor': ${targetConstructorInvocation.getText()}");
+ sb.write("'constructor': ${targetConstructorInvocation.toDartText()}");
sb.write("}");
return sb.toString();
}
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/constants/expressions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698