Index: src/js/regexp.js |
diff --git a/src/js/regexp.js b/src/js/regexp.js |
index b5574877ec3a19f16dd1fdbd5efbe9762e05b99f..915a44f0b54daec86f4f005660aa9383c988e34d 100644 |
--- a/src/js/regexp.js |
+++ b/src/js/regexp.js |
@@ -103,7 +103,6 @@ macro RETURN_NEW_RESULT_FROM_MATCH_INFO(MATCHINFO, STRING) |
endmacro |
- |
// ES#sec-regexpexec Runtime Semantics: RegExpExec ( R, S ) |
// Also takes an optional exec method in case our caller |
// has already fetched exec. |
@@ -123,19 +122,6 @@ function RegExpSubclassExec(regexp, string, exec) { |
%SetForceInlineFlag(RegExpSubclassExec); |
-// ES#sec-regexp.prototype.test RegExp.prototype.test ( S ) |
-function RegExpSubclassTest(string) { |
- if (!IS_RECEIVER(this)) { |
- throw %make_type_error(kIncompatibleMethodReceiver, |
- 'RegExp.prototype.test', this); |
- } |
- string = TO_STRING(string); |
- var match = RegExpSubclassExec(this, string); |
- return !IS_NULL(match); |
-} |
-%FunctionRemovePrototype(RegExpSubclassTest); |
- |
- |
function AtSurrogatePair(subject, index) { |
if (index + 1 >= subject.length) return false; |
var first = %_StringCharCodeAt(subject, index); |
@@ -289,39 +275,6 @@ function RegExpSubclassSplit(string, limit) { |
%FunctionRemovePrototype(RegExpSubclassSplit); |
-// ES#sec-regexp.prototype-@@match |
-// RegExp.prototype [ @@match ] ( string ) |
-function RegExpSubclassMatch(string) { |
- if (!IS_RECEIVER(this)) { |
- throw %make_type_error(kIncompatibleMethodReceiver, |
- "RegExp.prototype.@@match", this); |
- } |
- string = TO_STRING(string); |
- var global = this.global; |
- if (!global) return RegExpSubclassExec(this, string); |
- var unicode = this.unicode; |
- this.lastIndex = 0; |
- var array = new InternalArray(); |
- var n = 0; |
- var result; |
- while (true) { |
- result = RegExpSubclassExec(this, string); |
- if (IS_NULL(result)) { |
- if (n === 0) return null; |
- break; |
- } |
- var matchStr = TO_STRING(result[0]); |
- array[n] = matchStr; |
- if (matchStr === "") SetAdvancedStringIndex(this, string, unicode); |
- n++; |
- } |
- var resultArray = []; |
- %MoveArrayContents(array, resultArray); |
- return resultArray; |
-} |
-%FunctionRemovePrototype(RegExpSubclassMatch); |
- |
- |
// Legacy implementation of RegExp.prototype[Symbol.replace] which |
// doesn't properly call the underlying exec method. |
@@ -716,32 +669,11 @@ function RegExpSubclassReplace(string, replace) { |
%FunctionRemovePrototype(RegExpSubclassReplace); |
-// ES#sec-regexp.prototype-@@search |
-// RegExp.prototype [ @@search ] ( string ) |
-function RegExpSubclassSearch(string) { |
- if (!IS_RECEIVER(this)) { |
- throw %make_type_error(kIncompatibleMethodReceiver, |
- "RegExp.prototype.@@search", this); |
- } |
- string = TO_STRING(string); |
- var previousLastIndex = this.lastIndex; |
- if (previousLastIndex != 0) this.lastIndex = 0; |
- var result = RegExpSubclassExec(this, string); |
- var currentLastIndex = this.lastIndex; |
- if (currentLastIndex != previousLastIndex) this.lastIndex = previousLastIndex; |
- if (IS_NULL(result)) return -1; |
- return result.index; |
-} |
-%FunctionRemovePrototype(RegExpSubclassSearch); |
- |
// ------------------------------------------------------------------- |
utils.InstallFunctions(GlobalRegExp.prototype, DONT_ENUM, [ |
- "test", RegExpSubclassTest, |
- matchSymbol, RegExpSubclassMatch, |
replaceSymbol, RegExpSubclassReplace, |
- searchSymbol, RegExpSubclassSearch, |
splitSymbol, RegExpSubclassSplit, |
]); |