Skip to content

Commit a91f622

Browse files
author
Airan Shao
committed
replaceAll always replace str with ''
Should replace matching string with parameter "replacement", not ''.
1 parent 97d39b6 commit a91f622

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Pattern.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class Pattern
134134
count = 0
135135
while @regex.test(str) and (limit is 0 or count < limit)
136136
@regex.lastIndex = 0
137-
str = str.replace @regex, ''
137+
str = str.replace @regex, replacement
138138
count++
139139

140140
return [str, count]

0 commit comments

Comments
 (0)