Bug 248159 - An error in FinalizationRegistry's callback isn't reported properly
Summary: An error in FinalizationRegistry's callback isn't reported properly
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-20 16:43 PST by Alexey Shvayka
Modified: 2022-11-21 12:27 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Shvayka 2022-11-20 16:43:34 PST
const fooError = new Error("foo");
const registry = new FinalizationRegistry(() => {
  throw fooError;
});

window.addEventListener("error", event => {
  console.assert(event.error == fooError); // => fails
});
Comment 1 Alexey Shvayka 2022-11-21 12:27:19 PST
False alarm: I was testing via file:/// protocol. This is covered by https://wpt.fyi/results/js/builtins/weakrefs/finalizationregistry-cleanupCallback-throws-onerror-interaction.optional.window.html