[Webkit-unassigned] [Bug 275145] Incorrect source location for TDZ error in modules when thrown before other statements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 5 02:54:40 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=275145

--- Comment #2 from Jarred Sumner <jarred at jarredsumner.com> ---
Similar behavior occurs for `emitReadOnlyExceptionIfNeeded`

The following input:

```
const a = 1;
print(a);
a = 2;
```

Emits the following error:
```
❯ jsc -m /Users/jarred/Code/bun/src/bun.js/WebKit/a.js
1
Exception: TypeError: Attempted to assign to readonly property.
module code@/Users/jarred/Code/bun/src/bun.js/WebKit/a.js:2:6
```

The reported line number should be 3, which it is when not a module.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240605/d990d450/attachment.htm>


More information about the webkit-unassigned mailing list