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

Unified Diff: pkg/js_ast/lib/src/template.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: Florian's comments 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
« 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 eb4089ad807090f3b6270d5192658c0e6933e8ad..e0f0d5bb53972c846165247c3343deaaaeb6b3bd 100644
--- a/pkg/js_ast/lib/src/template.dart
+++ b/pkg/js_ast/lib/src/template.dart
@@ -59,20 +59,29 @@ class Template {
_compile();
}
- Template.withExpressionResult(this.ast)
+ Template.withExpressionResult(this.ast, {hasPlaceholders : false})
sra1 2015/05/19 20:56:54 I think we should keep 'withExpressionResult' for
herhut 2015/05/20 08:09:16 Done.
: source = null, isExpression = true, forceCopy = false {
assert(ast is Expression);
- assert(_checkNoPlaceholders());
- positionalArgumentCount = 0;
- instantiator = (arguments) => ast;
+ if (hasPlaceholders) {
+ _compile();
+ } else {
+ assert(_checkNoPlaceholders());
+ positionalArgumentCount = 0;
+ instantiator = (arguments) => ast;
+ }
}
- Template.withStatementResult(this.ast)
+ Template.withStatementResult(this.ast, {hasPlaceholders : false})
sra1 2015/05/19 20:56:55 Is this used?
herhut 2015/05/20 08:09:16 Removed.
: source = null, isExpression = false, forceCopy = false {
assert(ast is Statement);
- assert(_checkNoPlaceholders());
- positionalArgumentCount = 0;
- instantiator = (arguments) => ast;
+
+ if (hasPlaceholders) {
+ _compile();
+ } else {
+ assert(_checkNoPlaceholders());
+ positionalArgumentCount = 0;
+ instantiator = (arguments) => ast;
+ }
}
bool _checkNoPlaceholders() {
« 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