Index: sdk/lib/_internal/js_runtime/lib/js_names.dart |
diff --git a/sdk/lib/_internal/js_runtime/lib/js_names.dart b/sdk/lib/_internal/js_runtime/lib/js_names.dart |
index 708b873b7e5deed4e18bb17dbd499d77b1ea08fa..a0fe67f83f49e93a30c4021938b9aaa95929efbf 100644 |
--- a/sdk/lib/_internal/js_runtime/lib/js_names.dart |
+++ b/sdk/lib/_internal/js_runtime/lib/js_names.dart |
@@ -165,9 +165,14 @@ String unmangleGlobalNameIfPreservedAnyways(String name) { |
} |
String unmangleAllIdentifiersIfPreservedAnyways(String str) { |
- return JS("String", |
- r"(#).replace(/[^<,> ]+/g," |
- r"function(m) { return #[m] || m; })", |
- str, |
- JS_EMBEDDED_GLOBAL('', MANGLED_GLOBAL_NAMES)); |
-} |
+ return JS( |
+ 'String', |
+ r''' |
+ (function(str, names) { |
+ return str.replace( |
+ /[^<,> ]+/g, |
+ function(m) { return names[m] || m; }); |
+ })(#, #)''', |
+ str, |
+ JS_EMBEDDED_GLOBAL('', MANGLED_GLOBAL_NAMES)); |
+} |