Index: src/regexp.js |
diff --git a/src/regexp.js b/src/regexp.js |
index 9367f15f91d88cd36ae6e83b43f1945061166ee5..79ac44bb0308ad60f8d122488a2a3ae6cd9ff682 100644 |
--- a/src/regexp.js |
+++ b/src/regexp.js |
@@ -197,6 +197,7 @@ function RegExpExec(string) { |
%_ObjectEquals(cache.regExp, this) && |
%_ObjectEquals(cache.subject, string)) { |
if (cache.answerSaved) { |
+ if (this.global) this.lastIndex = 0; |
return CloneRegExpResult(cache.answer); |
} else { |
saveAnswer = true; |