summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémy Faivre <contact@jeremyfa.com>2017-02-12 00:37:51 +0100
committerGitHub <noreply@github.com>2017-02-12 00:37:51 +0100
commit452a6f9d4a0d0d216f90719196c6e619cb7f27ae (patch)
tree68af2e5f85a7759ab1c006afb4b421c185b5ddee
parent97d39b6c2bf533d33538205a399638b63f6baa66 (diff)
parenta91f62267610ce95fee24e4d25493caf7fb9d2b9 (diff)
downloadyamljs-452a6f9d4a0d0d216f90719196c6e619cb7f27ae.tar.gz
Merge pull request #82 from ar-shao/pattern
replaceAll always replace str with ''
-rw-r--r--src/Pattern.coffee2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Pattern.coffee b/src/Pattern.coffee
index e65fa79..82f96e7 100644
--- a/src/Pattern.coffee
+++ b/src/Pattern.coffee
@@ -134,7 +134,7 @@ class Pattern
count = 0
while @regex.test(str) and (limit is 0 or count < limit)
@regex.lastIndex = 0
- str = str.replace @regex, ''
+ str = str.replace @regex, replacement
count++
return [str, count]