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