Fix RegExp.prototype.compile.length to be 2

SpiderMonkey switched to 2, test262 tests for 2, and 2 is a reasonable, natural
value.

R=yangguo

Review URL: https://codereview.chromium.org/1616233002

Cr-Commit-Position: refs/heads/master@{#33504}
This commit is contained in:
littledan 2016-01-25 22:42:25 -08:00 committed by Commit bot
parent 22be78430a
commit efcd023e4a
2 changed files with 2 additions and 3 deletions

View File

@ -693,9 +693,6 @@ utils.InstallGetter(GlobalRegExp.prototype, 'ignoreCase', RegExpGetIgnoreCase);
utils.InstallGetter(GlobalRegExp.prototype, 'multiline', RegExpGetMultiline);
utils.InstallGetter(GlobalRegExp.prototype, 'source', RegExpGetSource);
// The length of compile is 1 in SpiderMonkey.
%FunctionSetLength(GlobalRegExp.prototype.compile, 1);
// The properties `input` and `$_` are aliases for each other. When this
// value is set the value it is set to is coerced to a string.
// Getter and setter for the input.

View File

@ -40,3 +40,5 @@ assertEquals(["x", "x"], re.exec("axyb"));
re.compile("(y)");
assertEquals(["y", "y"], re.exec("axyb"));
assertEquals(2, re.compile.length);