[regexp] remove no-op RegExp.multiline accessor and alias

Remove some non-standard code that doesn't do anything anyways.

While FireFox uses this to set the default value for the multiline flag,
it is nonstandard and slated for removal. The matching behaviour has
never been implemented in either JSC or V8, so there is little
web-compat risk.

The only possible risk could be someone depending on the ToBoolean()
behaviour of the flag, but this seems unlikely.

BUG=v8:3870
LOG=N
R=adamk@chromium.org, littledan@chromium.org, yangguo@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel

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

Cr-Commit-Position: refs/heads/master@{#31882}
This commit is contained in:
caitpotter88 2015-11-09 06:03:15 -08:00 committed by Commit bot
parent bde296670c
commit e63248f6d7
3 changed files with 5 additions and 21 deletions

View File

@ -416,25 +416,6 @@ var RegExpSetInput = function(string) {
%DefineAccessorPropertyUnchecked(GlobalRegExp, '$_', RegExpGetInput,
RegExpSetInput, DONT_ENUM | DONT_DELETE);
// The properties multiline and $* are aliases for each other. When this
// value is set in SpiderMonkey, the value it is set to is coerced to a
// boolean. We mimic that behavior with a slight difference: in SpiderMonkey
// the value of the expression 'RegExp.multiline = null' (for instance) is the
// boolean false (i.e., the value after coercion), while in V8 it is the value
// null (i.e., the value before coercion).
// Getter and setter for multiline.
var multiline = false;
var RegExpGetMultiline = function() { return multiline; };
var RegExpSetMultiline = function(flag) { multiline = flag ? true : false; };
%DefineAccessorPropertyUnchecked(GlobalRegExp, 'multiline', RegExpGetMultiline,
RegExpSetMultiline, DONT_DELETE);
%DefineAccessorPropertyUnchecked(GlobalRegExp, '$*', RegExpGetMultiline,
RegExpSetMultiline,
DONT_ENUM | DONT_DELETE);
var NoOpSetter = function(ignored) {};

View File

@ -144,8 +144,6 @@ for (var i = 1; i <= 9; i++) {
assertEquals("", RegExp['$' + (i)], "$" + i);
}
RegExp.multiline = "foo";
assertTrue(typeof RegExp.multiline == typeof Boolean(), "RegExp.multiline coerces values to booleans");
RegExp.input = Number();
assertTrue(typeof RegExp.input == typeof String(), "RegExp.input coerces values to booleans");

View File

@ -90,6 +90,11 @@
# ES2015 ToLength semantics
'ecma_3/RegExp/15.10.6.2-2': [FAIL],
# RegExp.multiline is not part of any ECMAScript specification, and is
# slated for deprecation in Mozilla
# (https://bugzilla.mozilla.org/show_bug.cgi?id=1220457)
'js1_5/Regress/regress-418504': [FAIL],
##################### SKIPPED TESTS #####################
# This test checks that we behave properly in an out-of-memory