Index: src/string.js |
diff --git a/src/string.js b/src/string.js |
index 3608bac8facc279b0d0c31cd299cec641e58d714..e858b0fd526e7c8b8995981460bf7130b5974228 100644 |
--- a/src/string.js |
+++ b/src/string.js |
@@ -244,6 +244,11 @@ function StringReplace(search, replace) { |
// Convert the search argument to a string and search for it. |
search = TO_STRING_INLINE(search); |
+ if (search.length == 1 && |
+ IS_STRING(replace) && |
+ %StringIndexOf(replace, '$', 0) < 0) { |
+ return %StringReplaceOneCharWithString(subject, search, replace); |
+ } |
var start = %StringIndexOf(subject, search, 0); |
if (start < 0) return subject; |
var end = start + search.length; |