<?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>141475</bug_id>
          
          <creation_ts>2015-02-11 08:21:34 -0800</creation_ts>
          <short_desc>Web Inspector: silent failure if introducing local variable in console when debugger paused</short_desc>
          <delta_ts>2016-12-13 15:33:46 -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>
          
          
          <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>mark.lam</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1068362</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Burg">burg</who>
    <bug_when>2015-02-11 08:21:34 -0800</bug_when>
    <thetext>When the debugger is paused, running

&gt; var x = 42;

in the console will not actually assign x to a local variable. This is fine, except that the command silently fails. If you later type

&gt; x

while still paused, a TypeError will be thrown. This is confusing if you don&apos;t know how the console/debugger is implemented.

So, should an error be thrown when a variable is introduced when debugger is paused, or should this work somehow?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068363</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-02-11 08:21:54 -0800</bug_when>
    <thetext>&lt;rdar://problem/19796707&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068400</commentid>
    <comment_count>2</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2015-02-11 10:47:50 -0800</bug_when>
    <thetext>I would expect this to just work while debugging.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068636</commentid>
    <comment_count>3</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2015-02-12 09:24:54 -0800</bug_when>
    <thetext>To work with strict mode we have to make a closure and call eval() inside it while paused in the debugger.

http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js#L409

The closure captures the var and it is thrown away each time. We could potentially reuse it while paused. But we really just need JSC support to avoid this hack.

It we could use with() while in strict mode, then we wouldn&apos;t need the closure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1195179</commentid>
    <comment_count>4</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-05-20 11:42:28 -0700</bug_when>
    <thetext>So this code has changed a bunch.

I believe doing `var x` will work outside of strict mode code.

Using `let x` probably won&apos;t work in strict or non-strict. And `var` probably won&apos;t work in strict mode.

If we wanted this to work, we&apos;d probably have to do some really tricky stuff. How do debuggers like lldb make this work? They store the result in a temporary variable, or you can create custom variables. Maybe we could approach this problem from that angle.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>