mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1918235 - Ship RegExp.escape proposal; r=iain,peterv
Differential Revision: https://phabricator.services.mozilla.com/D229203
This commit is contained in:
parent
bd0835dd27
commit
65cb7235c4
@ -990,7 +990,6 @@ const JSFunctionSpec js::regexp_methods[] = {
|
||||
JS_FS_END,
|
||||
};
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
static constexpr JS::Latin1Char SHOULD_HEX_ESCAPE = JSString::MAX_LATIN1_CHAR;
|
||||
|
||||
/**
|
||||
@ -1285,7 +1284,6 @@ static bool regexp_escape(JSContext* cx, unsigned argc, Value* vp) {
|
||||
args.rval().setString(result);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define STATIC_PAREN_GETTER_CODE(parenNum) \
|
||||
if (!res->createParen(cx, parenNum, args.rval())) return false; \
|
||||
@ -1389,9 +1387,7 @@ const JSPropertySpec js::regexp_static_props[] = {
|
||||
};
|
||||
|
||||
const JSFunctionSpec js::regexp_static_methods[] = {
|
||||
#ifdef NIGHTLY_BUILD
|
||||
JS_FN("escape", regexp_escape, 1, 0),
|
||||
#endif
|
||||
JS_FS_END,
|
||||
};
|
||||
|
||||
|
@ -17,7 +17,7 @@ work directly top-down)
|
||||
- ☐ Land feature disabled by pref.
|
||||
- ☐ Import the test262 test cases for the feature, or enable them if they're
|
||||
already imported. (See `js/src/test/Readme.txt` for guidance)
|
||||
- ☐ Contact `fuzzing@mozilla.com` to arrange fuzzing for the feature.
|
||||
- ☐ Add the `fuzzing:needed` label to the proposal epic in the FFXP project in JIRA to request fuzzing for the feature.
|
||||
- ☐ Add shell option to `js/src/shell/fuzz-flags.txt`. This signals to other
|
||||
fuzzers as well that the feature is ready for fuzzing.
|
||||
- ☐ Send an Intent to Ship Email to `dev-platform`. This is also part of the
|
||||
|
@ -12967,6 +12967,12 @@ bool SetGlobalOptionsPreJSInit(const OptionParser& op) {
|
||||
if (op.getBoolOption("enable-uint8array-base64")) {
|
||||
JS::Prefs::setAtStartup_experimental_uint8array_base64(true);
|
||||
}
|
||||
if (op.getBoolOption("enable-regexp-escape")) {
|
||||
JS::Prefs::setAtStartup_experimental_regexp_escape(true);
|
||||
}
|
||||
if (op.getBoolOption("enable-promise-try")) {
|
||||
JS::Prefs::setAtStartup_experimental_promise_try(true);
|
||||
}
|
||||
#ifdef NIGHTLY_BUILD
|
||||
if (op.getBoolOption("enable-async-iterator-helpers")) {
|
||||
JS::Prefs::setAtStartup_experimental_async_iterator_helpers(true);
|
||||
@ -12974,12 +12980,6 @@ bool SetGlobalOptionsPreJSInit(const OptionParser& op) {
|
||||
if (op.getBoolOption("enable-symbols-as-weakmap-keys")) {
|
||||
JS::Prefs::setAtStartup_experimental_symbols_as_weakmap_keys(true);
|
||||
}
|
||||
if (op.getBoolOption("enable-regexp-escape")) {
|
||||
JS::Prefs::setAtStartup_experimental_regexp_escape(true);
|
||||
}
|
||||
if (op.getBoolOption("enable-promise-try")) {
|
||||
JS::Prefs::setAtStartup_experimental_promise_try(true);
|
||||
}
|
||||
if (op.getBoolOption("enable-error-iserror")) {
|
||||
JS::Prefs::setAtStartup_experimental_error_iserror(true);
|
||||
}
|
||||
|
@ -2304,7 +2304,6 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx,
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
// It's gently surprising that this is JSProto_Function, but the trick
|
||||
// to realize is that this is a -constructor function-, not a function
|
||||
// on the prototype; and the proto of the constructor is JSProto_Function.
|
||||
@ -2313,6 +2312,7 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx,
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
if (key == JSProto_Math && !JS::Prefs::experimental_math_sumprecise() &&
|
||||
id == NameToId(cx->names().sumPrecise)) {
|
||||
return true;
|
||||
|
@ -290,7 +290,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=933681
|
||||
"flags", "dotAll", "global", "hasIndices", "ignoreCase", "multiline", "source", "sticky",
|
||||
"unicode", "unicodeSets"];
|
||||
gConstructorProperties.RegExp =
|
||||
constructorProps(["input", "lastMatch", "lastParen",
|
||||
constructorProps(["escape", "input", "lastMatch", "lastParen",
|
||||
"leftContext", "rightContext", "$1", "$2", "$3", "$4",
|
||||
"$5", "$6", "$7", "$8", "$9", "$_", "$&", "$+",
|
||||
"$`", "$'", Symbol.species])
|
||||
@ -953,7 +953,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=933681
|
||||
// RegExp[@@species] is affected by above skip, but we don't fix it until
|
||||
// compelling use-case appears, as supporting RegExp[@@species] while
|
||||
// skipping other static properties makes things complicated.
|
||||
let ctorPropsToSkip = ["input", "lastMatch", "lastParen",
|
||||
// Since RegExp.escape is a method, there's no obvious reason to skip it,
|
||||
// but it would require some changes in the Xray code (would need to special
|
||||
// case it in xpc::JSXrayTraits::resolveOwnProperty and
|
||||
// xpc::JSXrayTraits::enumerateNames) that are not necessarily worth the effort
|
||||
// since it is a static method with no state.
|
||||
let ctorPropsToSkip = ["escape", "input", "lastMatch", "lastParen",
|
||||
"leftContext", "rightContext", "$1", "$2", "$3",
|
||||
"$4", "$5", "$6", "$7", "$8", "$9", "$_", "$&",
|
||||
"$+", "$`", "$'", Symbol.species];
|
||||
|
@ -8212,6 +8212,13 @@
|
||||
mirror: always
|
||||
set_spidermonkey_pref: startup
|
||||
|
||||
# Experimental support for RegExp.escape in JavaScript.
|
||||
- name: javascript.options.experimental.regexp_escape
|
||||
type: bool
|
||||
value: true
|
||||
mirror: always
|
||||
set_spidermonkey_pref: startup
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
# Experimental support for Async Iterator Helpers in JavaScript.
|
||||
- name: javascript.options.experimental.async_iterator_helpers
|
||||
@ -8233,13 +8240,6 @@
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# Experimental support for RegExp.escape in JavaScript.
|
||||
- name: javascript.options.experimental.regexp_escape
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
set_spidermonkey_pref: startup
|
||||
|
||||
# Experimental support for Error.isError in JavaScript.
|
||||
- name: javascript.options.experimental.error_iserror
|
||||
type: bool
|
||||
|
Loading…
Reference in New Issue
Block a user