WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
300291
[JSC] Improve error messages for invalid constructor of derived classes
https://bugs.webkit.org/show_bug.cgi?id=300291
Summary
[JSC] Improve error messages for invalid constructor of derived classes
Sosuke Suzuki
Reported
2025-10-06 21:50:33 PDT
Returning non object values from constructor of derived class is invalid: class Base {} class Derived extends Base { constructor() { super(); return 123; } } new Derived(); Current JSC throws a TypeError with the message "Cannot return a non-object type in the constructor of a derived class." This patch changes this error message to include the constructor name for debugging experience.
Attachments
Add attachment
proposed patch, testcase, etc.
Sosuke Suzuki
Comment 1
2025-10-06 21:52:03 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/51914
EWS
Comment 2
2025-10-09 01:20:50 PDT
Committed
301258@main
(e2c7e56a9516): <
https://commits.webkit.org/301258@main
> Reviewed commits have been landed. Closing PR #51914 and removing active labels.
Radar WebKit Bug Importer
Comment 3
2025-10-09 01:21:12 PDT
<
rdar://problem/162267503
>
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