| Index: src/js/regexp.js
|
| diff --git a/src/js/regexp.js b/src/js/regexp.js
|
| index b9b096492b754095d41056f72e82411e49376e13..bde4c1fa2d3ce187f7b74c912a0b7576ff20d5e4 100644
|
| --- a/src/js/regexp.js
|
| +++ b/src/js/regexp.js
|
| @@ -207,46 +207,6 @@ function RegExpSubclassExecJS(string) {
|
| %FunctionRemovePrototype(RegExpSubclassExecJS);
|
|
|
|
|
| -// Legacy implementation of RegExp.prototype.exec
|
| -function RegExpExecJS(string) {
|
| - if (!IS_REGEXP(this)) {
|
| - throw %make_type_error(kIncompatibleMethodReceiver,
|
| - 'RegExp.prototype.exec', this);
|
| - }
|
| -
|
| - string = TO_STRING(string);
|
| - var lastIndex = this.lastIndex;
|
| -
|
| - // Conversion is required by the ES2015 specification (RegExpBuiltinExec
|
| - // algorithm, step 4) even if the value is discarded for non-global RegExps.
|
| - var i = TO_LENGTH(lastIndex);
|
| -
|
| - var updateLastIndex = REGEXP_GLOBAL(this) || REGEXP_STICKY(this);
|
| - if (updateLastIndex) {
|
| - if (i < 0 || i > string.length) {
|
| - this.lastIndex = 0;
|
| - return null;
|
| - }
|
| - } else {
|
| - i = 0;
|
| - }
|
| -
|
| - // matchIndices is either null or the RegExpLastMatchInfo array.
|
| - var matchIndices = %_RegExpExec(this, string, i, RegExpLastMatchInfo);
|
| -
|
| - if (IS_NULL(matchIndices)) {
|
| - this.lastIndex = 0;
|
| - return null;
|
| - }
|
| -
|
| - // Successful match.
|
| - if (updateLastIndex) {
|
| - this.lastIndex = RegExpLastMatchInfo[CAPTURE1];
|
| - }
|
| - RETURN_NEW_RESULT_FROM_MATCH_INFO(matchIndices, string);
|
| -}
|
| -
|
| -
|
| // ES#sec-regexpexec Runtime Semantics: RegExpExec ( R, S )
|
| // Also takes an optional exec method in case our caller
|
| // has already fetched exec.
|
| @@ -261,7 +221,7 @@ function RegExpSubclassExec(regexp, string, exec) {
|
| }
|
| return result;
|
| }
|
| - return %_Call(RegExpExecJS, regexp, string);
|
| + return %_Call(RegExpSubclassExecJS, regexp, string);
|
| }
|
| %SetForceInlineFlag(RegExpSubclassExec);
|
|
|
|
|