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

Unified Diff: pkg/compiler/lib/src/js_backend/runtime_types.dart

Issue 1140703006: dart2js: Construct the entire output as a single AST before printing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
Index: pkg/compiler/lib/src/js_backend/runtime_types.dart
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index e14487fc3a36b13665ab1f83497fef4b3cf23228..6f2e044c137b5fd6bbfa3810ea5c9c11f20e75eb 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -550,15 +550,16 @@ class RuntimeTypes {
}
}
- String getTypeRepresentationWithHashes(DartType type,
+ jsAst.Expression getTypeRepresentationWithHashes(DartType type,
floitsch 2015/05/19 13:43:35 Name is bad now.
herhut 2015/05/19 14:08:09 How about 'WithPlaceholders'? But in essence they
OnVariableCallback onVariable) {
// Create a type representation. For type variables call the original
// callback for side effects and return a template placeholder.
+ int positions = 0;
jsAst.Expression representation = getTypeRepresentation(type, (variable) {
onVariable(variable);
- return new jsAst.LiteralString('#');
+ return new jsAst.InterpolatedExpression(positions++);
});
- return jsAst.prettyPrint(representation, compiler).buffer.toString();
+ return representation;
}
jsAst.Expression getTypeRepresentation(

Powered by Google App Engine
This is Rietveld 408576698