Commit 65828698 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by V8 LUCI CQ

[Error.cause] Remove --harmony-error-cause

Error.cause has shipped since M93.

Bug: chromium:1192162
Change-Id: Ib6019f5796cc41447af70c325c90136bcbd774ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3624981
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80649}
parent e43a2540
......@@ -18,9 +18,7 @@ namespace internal {
// ES6 section 19.5.1.1 Error ( message )
BUILTIN(ErrorConstructor) {
HandleScope scope(isolate);
Handle<Object> options = FLAG_harmony_error_cause
? args.atOrUndefined(isolate, 2)
: isolate->factory()->undefined_value();
Handle<Object> options = args.atOrUndefined(isolate, 2);
RETURN_RESULT_OR_FAILURE(
isolate, ErrorUtils::Construct(isolate, args.target(), args.new_target(),
args.atOrUndefined(isolate, 1), options));
......
......@@ -550,7 +550,7 @@ MaybeHandle<JSObject> ErrorUtils::Construct(
JSObject);
}
if (FLAG_harmony_error_cause && !options->IsUndefined(isolate)) {
if (!options->IsUndefined(isolate)) {
// If Type(options) is Object and ? HasProperty(options, "cause") then
// a. Let cause be ? Get(options, "cause").
// b. Perform ! CreateNonEnumerableDataPropertyOrThrow(O, "cause", cause).
......
......@@ -335,7 +335,6 @@ DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
#define HARMONY_SHIPPING_BASE(V) \
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_atomics, "harmony atomics") \
V(harmony_error_cause, "harmony error cause property") \
V(harmony_object_has_own, "harmony Object.hasOwn") \
V(harmony_class_static_blocks, "harmony static initializer blocks") \
V(harmony_array_find_last, "harmony array find last helpers")
......
......@@ -1424,16 +1424,12 @@ static void InstallWithIntrinsicDefaultProto(Isolate* isolate,
static void InstallError(Isolate* isolate, Handle<JSObject> global,
Handle<String> name, int context_index,
Builtin error_constructor = Builtin::kErrorConstructor,
int error_function_length = 1,
int in_object_properties = 2) {
int error_function_length = 1) {
Factory* factory = isolate->factory();
if (FLAG_harmony_error_cause) {
in_object_properties += 1;
}
// Most Error objects consist of a message and a stack trace.
// Reserve two in-object properties for these.
// Most Error objects consist of a message, a stack trace, and possibly a
// cause. Reserve three in-object properties for these.
const int in_object_properties = 3;
const int kErrorObjectSize =
JSObject::kHeaderSize + in_object_properties * kTaggedSize;
Handle<JSFunction> error_fun = InstallFunction(
......@@ -2695,7 +2691,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
// -- A g g r e g a t e E r r o r
InstallError(isolate_, global, factory->AggregateError_string(),
Context::AGGREGATE_ERROR_FUNCTION_INDEX,
Builtin::kAggregateErrorConstructor, 2, 2);
Builtin::kAggregateErrorConstructor, 2);
// -- E v a l E r r o r
InstallError(isolate_, global, factory->EvalError_string(),
......@@ -4482,7 +4478,6 @@ void Genesis::InitializeConsole(Handle<JSObject> extras_binding) {
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_assertions)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_class_static_blocks)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_error_cause)
#ifdef V8_INTL_SUPPORT
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_best_fit_matcher)
......
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