Commit 606e9087 authored by legendecas's avatar legendecas Committed by V8 LUCI CQ

[init] Error cause should not present on Error.prototype

According to the spec https://tc39.github.io/proposal-error-cause,
the property 'cause' should not present on Error.prototype.

Bug: v8:12006
Change-Id: Ib1601769793b808c5f5a7065effcc77d1def4cbb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3037911Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75872}
parent bd3d9e4a
......@@ -1436,11 +1436,6 @@ static void InstallError(Isolate* isolate, Handle<JSObject> global,
JSObject::AddProperty(isolate, prototype, factory->message_string(),
factory->empty_string(), DONT_ENUM);
if (FLAG_harmony_error_cause) {
JSObject::AddProperty(isolate, prototype, factory->cause_string(),
factory->undefined_value(), DONT_ENUM);
}
if (context_index == Context::ERROR_FUNCTION_INDEX) {
Handle<JSFunction> to_string_fun =
SimpleInstallFunction(isolate, prototype, "toString",
......
......@@ -19,6 +19,8 @@
(function () {
const err = Error('message');
assertEquals(undefined, err.cause);
assertFalse('cause' in err);
assertFalse('cause' in Error.prototype);
})();
// Chained errors
......
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