<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Poor Error Message / Call Stack for TypeError: Cannot call a class constructor"
href="https://bugs.webkit.org/show_bug.cgi?id=147656">147656</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Poor Error Message / Call Stack for TypeError: Cannot call a class constructor
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>528+ (Nightly build)
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>JavaScriptCore
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>joepeck@webkit.org
</td>
</tr>
<tr>
<th>CC</th>
<td>bburg@apple.com, ggaren@apple.com, rniwa@webkit.org, saambarati1@gmail.com, utatane.tea@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>* 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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>