<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@apple.com" title="Mark Lam <mark.lam@apple.com>"> <span class="fn">Mark Lam</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=278235&action=diff" name="attach_278235" title="[PATCH] Proposed Fix">attachment 278235</a> <a href="attachment.cgi?id=278235&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&action=review">https://bugs.webkit.org/attachment.cgi?id=278235&action=review</a>
<span class="quote">> Source/JavaScriptCore/ChangeLog:11
> + in Scopes fails to resolve anything, consult the Scope Extension.</span >
lower case "scopes" here?
<span class="quote">> Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp:101
> + if (!scriptValue.isString())
> + 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">> Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp:173
> + 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">> Source/JavaScriptCore/runtime/Completion.cpp:131
> + globalObject->setGlobalScopeExtension(JSWithScope::create(exec->vm(), exec->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">> Source/JavaScriptCore/runtime/JSScope.cpp:212
> + if (JSScope* globalScopeExtension = scope->globalObject()->globalScopeExtension()) {
> + JSObject* object = JSScope::objectAtScope(globalScopeExtension);
> + if (object->hasProperty(exec, ident))
> + return object;
> + }</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>