<?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>147438</bug_id>
          
          <creation_ts>2015-07-29 22:18:18 -0700</creation_ts>
          <short_desc>Web Inspector: hard to find callers that cause ES6 TypeErrors thrown during inspector initialization</short_desc>
          <delta_ts>2016-12-13 15:34:29 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>147066</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Brian Burg">burg</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ggaren</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>jonowells</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1113298</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Burg">burg</who>
    <bug_when>2015-07-29 22:18:18 -0700</bug_when>
    <thetext>I have run into the following situation: a code refactoring I made introduced a TypeError, thrown by a caller that erroneously invokes an ES6 class constructor during inspector initialization. Unfortunately, the only error shown (with logging to console by stderr) is:

file:///Users/burg/repos/webkit-dev/WebKitBuild/Release/WebInspectorUI.framework/Resources/Views/DataGrid.js:28:16: CONSOLE ERROR TypeError: Cannot call a class constructor


Currently, ConsoleClient only captures a call stack for console messages with the &quot;trace&quot; type. So, the console only displays the first frame from the uncaught exception. The check that throws a TypeError is directly emitted into the constructor bytecode stream, which is what&apos;s seen here. But it&apos;s really the caller (next call frame) that we care about. So this seems to mostly be a problem associated with new ES6 errors with mysterious source locations.

I propose two possible fixes, which are not mutually exclusive:

* omit the call frame that&apos;s currently reported, since it is misleading to a user who is trying to debug the invalid call.
* always capture/log multiple stack frames for uncaught exceptions, just like ConsoleClient does for &quot;trace&quot; messages.

I welcome your thoughts on this issue prior to writing code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1113299</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-07-29 22:18:33 -0700</bug_when>
    <thetext>&lt;rdar://problem/22066390&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1113420</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-07-30 11:22:34 -0700</bug_when>
    <thetext>What I would probably do is remote debug the failed inspector with a known good inspector and then reload the failed inspector page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1124260</commentid>
    <comment_count>3</comment_count>
      <attachid>260764</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-09-08 09:41:09 -0700</bug_when>
    <thetext>Created attachment 260764
reduced test case</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>260764</attachid>
            <date>2015-09-08 09:41:09 -0700</date>
            <delta_ts>2015-09-08 09:41:09 -0700</delta_ts>
            <desc>reduced test case</desc>
            <filename>class-constructor-exception-first-call-frame.html</filename>
            <type>text/html</type>
            <size>516</size>
            <attacher name="Blaze Burg">bburg</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxodG1sPgo8Ym9keSBvbmxvYWQ9InJ1blRlc3QoKSI+CjxzY3JpcHQ+
CgpmdW5jdGlvbiBydW5UZXN0KCkKewogICAgY2xhc3MgRm9vIHsKICAgICAgICBjb25zdHJ1Y3Rv
cigpIHsKICAgICAgICAgICAgCiAgICAgICAgfQogICAgfQoKICAgIGNsYXNzIEJhciBleHRlbmRz
IEZvbyB7CiAgICAgICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgICAgIEZvby5jYWxsKG51bGwp
OwogICAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBsZXZlbF8xKCkgewogICAgICAgIGxldmVs
XzIoKTsKICAgIH0KCiAgICBmdW5jdGlvbiBsZXZlbF8yKCkgewogICAgICAgIGxldmVsXzMoKTsK
ICAgIH0KCiAgICBmdW5jdGlvbiBsZXZlbF8zKCkgewogICAgICAgIG5ldyBCYXI7CiAgICB9Cgog
ICAgbGV2ZWxfMSgpOwp9Cgo8L3NjcmlwdD4KCjxwPlRvIHJlcHJvZHVjZSB0aGUgYnVnLCBvcGVu
IHRoZSBXZWIgSW5zcGVjdG9yIGFuZCByZWxvYWQgdGhlIHBhZ2UuPC9wPgoKPC9ib2R5Pgo8L2h0
bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>