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

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

Issue 11312203: "Reverting 14829-14832" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 e29f7bb489290ded16df154daa433aab8f2e74b2..5bdbfd98b0c2ca90f35c197b7fbd5bee717579f5 100644
--- a/sdk/lib/_internal/compiler/implementation/js/printer.dart
+++ b/sdk/lib/_internal/compiler/implementation/js/printer.dart
@@ -15,7 +15,6 @@ class Printer implements NodeVisitor {
final Namer namer;
bool pendingSemicolon = false;
bool pendingSpace = false;
- static final identifierRegexp = new RegExp(r'^[a-zA-Z_0-9$]');
Printer(leg.Compiler compiler, { allowVariableMinification: true })
: shouldCompressOutput = compiler.enableMinification,
@@ -47,6 +46,7 @@ class Printer implements NodeVisitor {
void out(String str) {
if (str != "") {
+ const identifierRegexp = const RegExp(r'^[a-zA-Z_0-9$]');
if (pendingSemicolon && (!shouldCompressOutput || str != "}")) {
outBuffer.add(";");
}
@@ -1067,7 +1067,7 @@ class MinifyRenamer implements Namer {
codes.add(charCodes.$0 + digit);
newName = new String.fromCharCodes(codes);
}
- assert(new RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName));
+ assert(const RegExp(r'[a-zA-Z][a-zA-Z0-9]*').hasMatch(newName));
maps.last[oldName] = newName;
return newName;
}

Powered by Google App Engine
This is Rietveld 408576698