[Webkit-unassigned] [Bug 150752] Web Inspector: Console: Variables defined with let/const aren't accessible outside of console's scope

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 6 11:59:31 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=150752

--- Comment #16 from Mark Lam <mark.lam at apple.com> ---
Comment on attachment 278235
  --> https://bugs.webkit.org/attachment.cgi?id=278235
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=278235&action=review

> Source/JavaScriptCore/ChangeLog:11
> +        in Scopes fails to resolve anything, consult the Scope Extension.

lower case "scopes" here?

> Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp:101
> +    if (!scriptValue.isString())
> +        return scriptValue;

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.

> Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp:173
> +    ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());

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

> Source/JavaScriptCore/runtime/Completion.cpp:131
> +        globalObject->setGlobalScopeExtension(JSWithScope::create(exec->vm(), exec->lexicalGlobalObject(), scopeExtensionObject, ignoredPreviousScope));

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

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

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?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160506/cf5a2d57/attachment.html>


More information about the webkit-unassigned mailing list