| 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 975cbf6dd43ba44f12bd45edf1f812c0c35fb082..38c9449ba582b223acdaea8a1b7fd30d72c46322 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/js/printer.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/js/printer.dart
|
| @@ -878,17 +878,24 @@ class Printer implements NodeVisitor {
|
| outLn(node.code);
|
| }
|
|
|
| - visitJSExpression(JSExpression node) {
|
| - compiler.internalError(NO_LOCATION_SPANNABLE,
|
| - 'JSPrinter should never see a JSExpression.');
|
| + visitInterpolatedNode(InterpolatedNode node) {
|
| + out('#${node.name}');
|
| }
|
|
|
| - visitInterpolatedExpression(InterpolatedExpression node) {
|
| - visit(node.value);
|
| - }
|
| + visitInterpolatedExpression(InterpolatedExpression node) =>
|
| + visitInterpolatedNode(node);
|
| +
|
| + visitInterpolatedLiteral(InterpolatedLiteral node) =>
|
| + visitInterpolatedNode(node);
|
| +
|
| + visitInterpolatedParameter(InterpolatedParameter node) =>
|
| + visitInterpolatedNode(node);
|
| +
|
| + visitInterpolatedSelector(InterpolatedSelector node) =>
|
| + visitInterpolatedNode(node);
|
|
|
| visitInterpolatedStatement(InterpolatedStatement node) {
|
| - visit(node.value);
|
| + outLn('#${node.name}');
|
| }
|
|
|
| void visitComment(Comment node) {
|
| @@ -1103,6 +1110,12 @@ 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.
|
|
|