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

Unified Diff: pkg/js_ast/lib/src/template.dart

Issue 1153243003: dart2js: Use frequency of occurence to sort metadata indices. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Addressed sra's comments Created 5 years, 6 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/js_ast/lib/src/printer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/js_ast/lib/src/template.dart
diff --git a/pkg/js_ast/lib/src/template.dart b/pkg/js_ast/lib/src/template.dart
index e7aa86349138ef90b14c60f729f5dfb6da4d4d33..c3dca1979305d90083a67b65ca9b2a6f4ab40b6a 100644
--- a/pkg/js_ast/lib/src/template.dart
+++ b/pkg/js_ast/lib/src/template.dart
@@ -654,6 +654,13 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
};
}
+ Instantiator visitDeferredExpression(DeferredExpression node) => same(node);
+
+ Instantiator visitDeferredNumber(DeferredNumber node) => same(node);
+
+ Instantiator visitDeferredString(DeferredString node) =>
+ (arguments) => node;
+
Instantiator visitLiteralBool(LiteralBool node) =>
(arguments) => new LiteralBool(node.value);
@@ -666,6 +673,18 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
Instantiator visitLiteralNull(LiteralNull node) =>
(arguments) => new LiteralNull();
+ Instantiator visitStringConcatenation(StringConcatenation node) {
+ List<Instantiator> partMakers = node.parts
+ .map(visit)
+ .toList(growable: false);
+ return (arguments) {
+ List<Literal> parts = partMakers
+ .map((Instantiator instantiator) => instantiator(arguments))
+ .toList(growable: false);
+ return new StringConcatenation(parts);
+ };
+ }
+
Instantiator visitArrayInitializer(ArrayInitializer node) {
// TODO(sra): Implement splicing?
List<Instantiator> elementMakers = node.elements
« no previous file with comments | « pkg/js_ast/lib/src/printer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698