<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>147656</bug_id>
          
          <creation_ts>2015-08-04 15:27:21 -0700</creation_ts>
          <short_desc>Poor Error Message / Call Stack for TypeError: Cannot call a class constructor</short_desc>
          <delta_ts>2015-08-04 15:28:20 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bburg</cc>
    
    <cc>ggaren</cc>
    
    <cc>joepeck</cc>
    
    <cc>rniwa</cc>
    
    <cc>saam</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1114809</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-08-04 15:27:21 -0700</bug_when>
    <thetext>* SUMMARY
Poor Error Message / Call Stack for TypeError: Cannot call a class constructor. It points to the &quot;constructor&quot; instead of the &quot;call&quot; site.

* TEST:

  1  &lt;script&gt;
  2  class MyClass {
  3      constructor() { this.name = &quot;name&quot;; }
  4  }
  5  function OtherClass() {
  6      MyClass.call(this);
  7  }
  8  x = new OtherClass;
  9  &lt;/script&gt;


* STEPS TO REPRODUCE
1. Run attached test case
  =&gt; Error in console points to the &quot;constructor&quot; line, expected it to point to the frame above, the &quot;call&quot; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114811</commentid>
    <comment_count>1</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-08-04 15:28:20 -0700</bug_when>
    <thetext>Also it might be good to use the class&apos; name if it has one. It might not though.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>