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

Unified Diff: sdk/lib/_internal/compiler/implementation/js/printer.dart

Issue 246633006: Revert "JS templates" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
Index: sdk/lib/_internal/compiler/implementation/js/printer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js/printer.dart b/sdk/lib/_internal/compiler/implementation/js/printer.dart
index 38c9449ba582b223acdaea8a1b7fd30d72c46322..975cbf6dd43ba44f12bd45edf1f812c0c35fb082 100644
--- a/sdk/lib/_internal/compiler/implementation/js/printer.dart
+++ b/sdk/lib/_internal/compiler/implementation/js/printer.dart
@@ -878,24 +878,17 @@ class Printer implements NodeVisitor {
outLn(node.code);
}
- visitInterpolatedNode(InterpolatedNode node) {
- out('#${node.name}');
+ visitJSExpression(JSExpression node) {
+ compiler.internalError(NO_LOCATION_SPANNABLE,
+ 'JSPrinter should never see a JSExpression.');
}
- visitInterpolatedExpression(InterpolatedExpression node) =>
- visitInterpolatedNode(node);
-
- visitInterpolatedLiteral(InterpolatedLiteral node) =>
- visitInterpolatedNode(node);
-
- visitInterpolatedParameter(InterpolatedParameter node) =>
- visitInterpolatedNode(node);
-
- visitInterpolatedSelector(InterpolatedSelector node) =>
- visitInterpolatedNode(node);
+ visitInterpolatedExpression(InterpolatedExpression node) {
+ visit(node.value);
+ }
visitInterpolatedStatement(InterpolatedStatement node) {
- outLn('#${node.name}');
+ visit(node.value);
}
void visitComment(Comment node) {
@@ -1110,12 +1103,6 @@ class MinifyRenamer implements LocalNamer {
// use the same namespace for arguments and variables, starting with A, and
// moving on to a0, a1, etc.
String declareVariable(String oldName) {
- // Variables of this $form$ are used in pattern matching the message of JS
- // exceptions, so should not be renamed.
- // TODO(sra): Introduce a way for indicating in the JS text which variables
- // should not be renamed.
- if (oldName.startsWith(r'$') && oldName.endsWith(r'$')) return oldName;
-
var newName;
if (variableNumber + parameterNumber < LOWER_CASE_LETTERS) {
// Variables start from z and go backwards, for better gzipability.
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js/nodes.dart ('k') | sdk/lib/_internal/compiler/implementation/js/template.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698