RESOLVED FIXED300291
[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
Sosuke Suzuki
Comment 1 2025-10-06 21:52:03 PDT
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
Note You need to log in before you can comment on or make changes to this bug.