Index: src/regexp.js |
diff --git a/src/regexp.js b/src/regexp.js |
index bf75ca1b011e4f5a30013a84621a9d9e3b5a882b..6c6b11cfd624c7e5ff5a5aad5ef7e2bc2a50181c 100644 |
--- a/src/regexp.js |
+++ b/src/regexp.js |
@@ -154,9 +154,9 @@ |
string = TO_STRING_INLINE(string); |
var lastIndex = this.lastIndex; |
- // Conversion is required by the ES5 specification (RegExp.prototype.exec |
- // algorithm, step 5) even if the value is discarded for non-global RegExps. |
- var i = TO_INTEGER(lastIndex); |
+ // Conversion is required by the ES6 specification (RegExpBuiltinExec |
+ // algorithm, step 4) even if the value is discarded for non-global RegExps. |
+ var i = $toLength(lastIndex); |
var updateLastIndex = this.global || (harmony_regexps && this.sticky); |
if (updateLastIndex) { |
@@ -202,9 +202,9 @@ |
var lastIndex = this.lastIndex; |
- // Conversion is required by the ES5 specification (RegExp.prototype.exec |
- // algorithm, step 5) even if the value is discarded for non-global RegExps. |
- var i = TO_INTEGER(lastIndex); |
+ // Conversion is required by the ES6 specification (RegExpBuiltinExec |
+ // algorithm, step 4) even if the value is discarded for non-global RegExps. |
+ var i = $toLength(lastIndex); |
if (this.global || (harmony_regexps && this.sticky)) { |
if (i < 0 || i > string.length) { |