Bug 300291
| Summary: | [JSC] Improve error messages for invalid constructor of derived classes | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sosuke Suzuki <sosuke> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Sosuke Suzuki
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
Pull request: https://github.com/WebKit/WebKit/pull/51914
EWS
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
<rdar://problem/162267503>