<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Web Inspector: Console: Variables defined with let/const aren't accessible outside of console's scope"
   href="https://bugs.webkit.org/show_bug.cgi?id=150752#c16">Comment # 16</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Web Inspector: Console: Variables defined with let/const aren't accessible outside of console's scope"
   href="https://bugs.webkit.org/show_bug.cgi?id=150752">bug 150752</a>
              from <span class="vcard"><a class="email" href="mailto:mark.lam&#64;apple.com" title="Mark Lam &lt;mark.lam&#64;apple.com&gt;"> <span class="fn">Mark Lam</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=278235&amp;action=diff" name="attach_278235" title="[PATCH] Proposed Fix">attachment 278235</a> <a href="attachment.cgi?id=278235&amp;action=edit" title="[PATCH] Proposed Fix">[details]</a></span>
[PATCH] Proposed Fix

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=278235&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=278235&amp;action=review</a>

<span class="quote">&gt; Source/JavaScriptCore/ChangeLog:11
&gt; +        in Scopes fails to resolve anything, consult the Scope Extension.</span >

lower case &quot;scopes&quot; here?

<span class="quote">&gt; Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp:101
&gt; +    if (!scriptValue.isString())
&gt; +        return scriptValue;</span >

Is this correct  ... that we want to return the bad argument if it's not a string?  Should we be throwing an error instead?  Looks like we're already getting this treatment below if toString() fails.

<span class="quote">&gt; Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp:173
&gt; +    ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());</span >

I think this assertion can never fail given the jsDynamicCast above.  Please remove since it does unnecessary work.

<span class="quote">&gt; Source/JavaScriptCore/runtime/Completion.cpp:131
&gt; +        globalObject-&gt;setGlobalScopeExtension(JSWithScope::create(exec-&gt;vm(), exec-&gt;lexicalGlobalObject(), scopeExtensionObject, ignoredPreviousScope));</span >

This seems weird that we create the WithScope with the lexicalGlobalObject but we set the extension on the VM entry globalObject.  Is this correct?

<span class="quote">&gt; Source/JavaScriptCore/runtime/JSScope.cpp:212
&gt; +            if (JSScope* globalScopeExtension = scope-&gt;globalObject()-&gt;globalScopeExtension()) {
&gt; +                JSObject* object = JSScope::objectAtScope(globalScopeExtension);
&gt; +                if (object-&gt;hasProperty(exec, ident))
&gt; +                    return object;
&gt; +            }</span >

This seems contrary to what you told me offline.  I thought you said wanted the global to take precedence over the Inspector's scopeExtension.  Here, you're checking for the property in the scope extension first.  Is this correct?</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>