Backed out changeset 7f63be4e0e59 (bug 1952249) for causing build bustages @ ErrorObject.cpp CLOSED TREE

This commit is contained in:
Sandor Molnar
2025-03-18 13:30:28 +02:00
parent 3a5c5233b8
commit 1b4ecd97b4
4 changed files with 22 additions and 19 deletions

View File

@@ -12956,9 +12956,6 @@ bool SetGlobalOptionsPreJSInit(const OptionParser& op) {
if (op.getBoolOption("enable-atomics-pause")) {
JS::Prefs::setAtStartup_experimental_atomics_pause(true);
}
if (op.getBoolOption("enable-error-iserror")) {
JS::Prefs::set_experimental_error_iserror(true);
}
#ifdef NIGHTLY_BUILD
if (op.getBoolOption("enable-async-iterator-helpers")) {
JS::Prefs::setAtStartup_experimental_async_iterator_helpers(true);
@@ -12966,6 +12963,9 @@ 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-error-iserror")) {
JS::Prefs::set_experimental_error_iserror(true);
}
if (op.getBoolOption("enable-iterator-sequencing")) {
JS::Prefs::setAtStartup_experimental_iterator_sequencing(true);
}

View File

@@ -979,6 +979,8 @@ static bool exn_toSource(JSContext* cx, unsigned argc, Value* vp) {
return true;
}
#ifdef NIGHTLY_BUILD
/**
* Error.isError Proposal
* Error.isError ( arg )
@@ -1026,6 +1028,7 @@ static bool exn_isError(JSContext* cx, unsigned argc, Value* vp) {
args.rval().setBoolean(false);
return true;
}
#endif
// The below is the "documentation" from https://v8.dev/docs/stack-trace-api
//

View File

@@ -2259,10 +2259,6 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx,
id == NameToId(cx->names().try_)) {
return true;
}
if (!JS::Prefs::experimental_error_iserror() &&
id == NameToId(cx->names().isError)) {
return true;
}
}
#ifdef JS_HAS_TEMPORAL_API
@@ -2277,6 +2273,10 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx,
// to realize is that this is a -constructor function-, not a function
// on the prototype; and the proto of the constructor is JSProto_Function.
if (key == JSProto_Function) {
if (!JS::Prefs::experimental_error_iserror() &&
id == NameToId(cx->names().isError)) {
return true;
}
if (!JS::Prefs::experimental_iterator_range() &&
(id == NameToId(cx->names().range))) {
return true;

View File

@@ -8518,13 +8518,6 @@
mirror: always
set_spidermonkey_pref: startup
# Experimental support for Error.isError in JavaScript.
- name: javascript.options.experimental.error_iserror
type: bool
value: true
mirror: always
set_spidermonkey_pref: always
#ifdef NIGHTLY_BUILD
# Experimental support for Async Iterator Helpers in JavaScript.
- name: javascript.options.experimental.async_iterator_helpers
@@ -8540,6 +8533,13 @@
mirror: always
set_spidermonkey_pref: startup
# Experimental support for Error.isError in JavaScript.
- name: javascript.options.experimental.error_iserror
type: bool
value: false
mirror: always
set_spidermonkey_pref: always
# Experimental support for Iterator.range in JavaScript.
- name: javascript.options.experimental.iterator_range
type: bool