Commit e8f752ce authored by yangguo's avatar yangguo Committed by Commit bot

Remove RegExp.multiline accessors.

This is non-standard and not even documented on MDN.

On Firefox, setting RegExp.multiline to true adds the multiline flag to all
newly created RegExp objects (both from constructor and from literal).

In V8 this has no effect.

Source archaelogy shows that this is from the initial commit.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#31673}
parent 897a5844
......@@ -367,25 +367,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) {};
......
......@@ -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");
......
......@@ -91,6 +91,9 @@
# In ES6, the completion value of a 0-iterations loop is 'undefined'.
'ecma/Statements/12.6.3-2': [PASS, FAIL],
# RegExp.multiline is not documented or specified anywhere.
'js1_5/Regress/regress-418504': [FAIL],
##################### SKIPPED TESTS #####################
# This test checks that we behave properly in an out-of-memory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment