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

Unified Diff: sdk/lib/_internal/lib/string_helper.dart

Issue 251373006: Fix dart2js replace to escape all dollar characters in the replacement string. (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
« no previous file with comments | « no previous file | tests/corelib/string_replace_dollar_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/string_helper.dart
diff --git a/sdk/lib/_internal/lib/string_helper.dart b/sdk/lib/_internal/lib/string_helper.dart
index 328cf2909184940127157ee6929976bd67efed7e..e3fb93b40470279eb685584a98d8114f5d36849b 100644
--- a/sdk/lib/_internal/lib/string_helper.dart
+++ b/sdk/lib/_internal/lib/string_helper.dart
@@ -73,7 +73,7 @@ stringReplaceJS(receiver, replacer, to) {
// The JavaScript String.replace method recognizes replacement
// patterns in the replacement string. Dart does not have that
// behavior.
- to = JS('String', r'#.replace("$", "$$$$")', to);
+ to = JS('String', r'#.replace(/\$/g, "$$$$")', to);
return JS('String', r'#.replace(#, #)', receiver, replacer, to);
}
« no previous file with comments | « no previous file | tests/corelib/string_replace_dollar_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698