Bug 259439
| Summary: | await promise prevents error being thrown in JavaScript module | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | beaufort.francois |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bugs.webkit, mark.lam, webkit-bug-importer, ysuzuki |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
beaufort.francois
I noticed awaiting a promise after an error was thrown in a JavaScript module does not actually throw the error.
window.onerror is never called, and the JavaScript console is empty.
```
<script type="module">
throw new Error();
// Adding this line will never throw the error in JavaScript console.
await Promise.resolve();
</script>
```
Note that I can't reproduce in Chrome and Firefox.
Demo: https://early-glamorous-botany.glitch.me/
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/113127236>
Alexey Shvayka
*** Bug 258662 has been marked as a duplicate of this bug. ***