[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 15:43:55 PDT 2016


--- Comment #18 from Joseph Pecoraro <joepeck at webkit.org> ---
> > 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?

Debugging with Mark we found that my impl was mistakenly between the GlobalLexicalEnvironment and the GlobalObject itself. I wasn't aware of global properties on the global object differed from global variables. Examples of that are named properties on the DOMWindowGlobalObject (or static properties on JSGlobalObject, but none conflict with Command Line APIs).

So with this test case:

    <div id="values"></div>

There is a "global property" `values` === `window.values`, that should not be shadowed by the Command Line API function named `values`. I added a test for this and corrected the resolve.

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/18fa61d5/attachment-0001.html>

More information about the webkit-unassigned mailing list