Commit 71668bbb authored by jgruber's avatar jgruber Committed by Commit bot

[regexp] Install all getters and setters as DONT_ENUM

Prior to 69debbb5, InstallGetterSetter
was bugged and ignored all passed attributes, installing as DONT_ENUM
instead. This commit makes sure we match old behavior now that that bug
is fixed.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2316513003
Cr-Commit-Position: refs/heads/master@{#39191}
parent 817a60cc
......@@ -1166,11 +1166,17 @@ var RegExpSetInput = function(string) {
LAST_INPUT(RegExpLastMatchInfo) = TO_STRING(string);
};
// TODO(jgruber): All of these getters and setters were intended to be installed
// with various attributes (e.g. DONT_ENUM | DONT_DELETE), but
// InstallGetterSetter had a bug which ignored the passed attributes and
// simply installed as DONT_ENUM instead. We might want to change back
// to the intended attributes at some point.
%OptimizeObjectForAddingMultipleProperties(GlobalRegExp, 22);
utils.InstallGetterSetter(GlobalRegExp, 'input', RegExpGetInput, RegExpSetInput,
DONT_DELETE);
DONT_ENUM);
utils.InstallGetterSetter(GlobalRegExp, '$_', RegExpGetInput, RegExpSetInput,
DONT_ENUM | DONT_DELETE);
DONT_ENUM);
var NoOpSetter = function(ignored) {};
......@@ -1178,25 +1184,25 @@ var NoOpSetter = function(ignored) {};
// Static properties set by a successful match.
utils.InstallGetterSetter(GlobalRegExp, 'lastMatch', RegExpGetLastMatch,
NoOpSetter, DONT_DELETE);
NoOpSetter, DONT_ENUM);
utils.InstallGetterSetter(GlobalRegExp, '$&', RegExpGetLastMatch, NoOpSetter,
DONT_ENUM | DONT_DELETE);
DONT_ENUM);
utils.InstallGetterSetter(GlobalRegExp, 'lastParen', RegExpGetLastParen,
NoOpSetter, DONT_DELETE);
NoOpSetter, DONT_ENUM);
utils.InstallGetterSetter(GlobalRegExp, '$+', RegExpGetLastParen, NoOpSetter,
DONT_ENUM | DONT_DELETE);
DONT_ENUM);
utils.InstallGetterSetter(GlobalRegExp, 'leftContext', RegExpGetLeftContext,
NoOpSetter, DONT_DELETE);
NoOpSetter, DONT_ENUM);
utils.InstallGetterSetter(GlobalRegExp, '$`', RegExpGetLeftContext, NoOpSetter,
DONT_ENUM | DONT_DELETE);
DONT_ENUM);
utils.InstallGetterSetter(GlobalRegExp, 'rightContext', RegExpGetRightContext,
NoOpSetter, DONT_DELETE);
NoOpSetter, DONT_ENUM);
utils.InstallGetterSetter(GlobalRegExp, "$'", RegExpGetRightContext, NoOpSetter,
DONT_ENUM | DONT_DELETE);
DONT_ENUM);
for (var i = 1; i < 10; ++i) {
utils.InstallGetterSetter(GlobalRegExp, '$' + i, RegExpMakeCaptureGetter(i),
NoOpSetter, DONT_DELETE);
NoOpSetter, DONT_ENUM);
}
%ToFastProperties(GlobalRegExp);
......
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