WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
147656
Poor Error Message / Call Stack for TypeError: Cannot call a class constructor
https://bugs.webkit.org/show_bug.cgi?id=147656
Summary
Poor Error Message / Call Stack for TypeError: Cannot call a class constructor
Joseph Pecoraro
Reported
2015-08-04 15:27:21 PDT
* SUMMARY Poor Error Message / Call Stack for TypeError: Cannot call a class constructor. It points to the "constructor" instead of the "call" site. * TEST: 1 <script> 2 class MyClass { 3 constructor() { this.name = "name"; } 4 } 5 function OtherClass() { 6 MyClass.call(this); 7 } 8 x = new OtherClass; 9 </script> * STEPS TO REPRODUCE 1. Run attached test case => Error in console points to the "constructor" line, expected it to point to the frame above, the "call" site. TypeError: Cannot call a class constructor MyClass test.html:3 OtherClass test.html:6 (anonymous function) test.html:8 * NOTES - Inspector currently has an off by 1 error in its stack trace output which is getting corrected at the moment.
Attachments
Add attachment
proposed patch, testcase, etc.
Joseph Pecoraro
Comment 1
2015-08-04 15:28:20 PDT
Also it might be good to use the class' name if it has one. It might not though.
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