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

Unified Diff: sdk/lib/_internal/js_runtime/lib/js_helper.dart

Issue 1557673002: js_runtime: streamline stringReplaceAllUnchecked (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: fix Created 4 years, 12 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 | « no previous file | sdk/lib/_internal/js_runtime/lib/string_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/js_helper.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index 48e1efa6f5aac001d6bc9918ec2e63201c860a0f..49765627b9c52d1e0a693be6ed7b69e20dbabfdf 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -1932,8 +1932,7 @@ class TypeErrorDecoder {
// Since we want to create a new regular expression from an unknown string,
// we must escape all regular expression syntax.
- message = JS('String', r"#.replace(new RegExp(#, 'g'), '\\$&')",
- message, ESCAPE_REGEXP);
+ message = quoteStringForRegExp(message);
// Look for the special pattern \$camelCase\$ (all the $ symbols
// have been escaped already), as we will soon be inserting
« no previous file with comments | « no previous file | sdk/lib/_internal/js_runtime/lib/string_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698