[Webkit-unassigned] [Bug 147656] New: Poor Error Message / Call Stack for TypeError: Cannot call a class constructor

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 4 15:27:21 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=147656

            Bug ID: 147656
           Summary: Poor Error Message / Call Stack for TypeError: Cannot
                    call a class constructor
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: joepeck at webkit.org
                CC: bburg at apple.com, ggaren at apple.com, rniwa at webkit.org,
                    saambarati1 at gmail.com, utatane.tea at gmail.com

* 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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150804/a2262d71/attachment.html>


More information about the webkit-unassigned mailing list