WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
260324
Incorrect error message in accidental function call
https://bugs.webkit.org/show_bug.cgi?id=260324
Summary
Incorrect error message in accidental function call
SheetJS
Reported
2023-08-16 19:09:12 PDT
Reproduction: ```js console.log("hi") (async() => { console.log("hi"); console.log("hi"); console.log("hi"); console.log("hi"); console.log("hi"); console.log("hi"); })(); ``` This is interpreted as `console.log("hi")(/*...*/)();` and throws an error since `console.log("hi")` returns `undefined`. . V8 correctly diagnoses the error. Running in the Chrome DevTools shows the error: ``` Uncaught TypeError: console.log(...) is not a function ``` . Safari 16 and Bun 0.7.3 both misdiagnose the error: ``` TypeError: console.log is not a function. (In 'console.log("hi")', 'console.log' is undefined) ``` To be clear, `console.log` is not undefined in context. . This appears to be related to the size of the function body. For example, if one of the console calls is removed: ```js console.log("hi") (async() => { console.log("hi"); console.log("hi"); console.log("hi"); console.log("hi"); console.log("hi"); })(); ``` Safari and Bun both show correct error messages: ``` TypeError: console.log("hi") is not a function. (In 'console.log("hi") (async() => { console.log("hi"); console.log("hi"); console.log("hi"); console.log("hi"); console.log("hi"); })', 'console.log("hi") ' is undefined) ``` This message is correct: `console.log("hi")` is undefined.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-08-23 19:10:21 PDT
<
rdar://problem/114357179
>
Mark Lam
Comment 2
2024-01-17 14:06:48 PST
This incorrect error message is an accidental by-product of a truncated error message. I'll be fixing this by compressing ExpressionInfo as well as changing it to no longer discard divot info.
Mark Lam
Comment 3
2024-01-17 14:47:41 PST
Pull request:
https://github.com/WebKit/WebKit/pull/22880
EWS
Comment 4
2024-01-19 12:07:02 PST
Committed
273233@main
(126d2027f1ce): <
https://commits.webkit.org/273233@main
> Reviewed commits have been landed. Closing PR #22880 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug