[Webkit-unassigned] [Bug 139449] Web Inspector: Scope details sidebar should label objects with constructor names

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Feb 14 00:33:08 PST 2015


Joseph Pecoraro <joepeck at webkit.org> changed:

           What    |Removed                     |Added
           Assignee|webkit-unassigned at lists.web |joepeck at webkit.org
                   |kit.org                     |

--- Comment #3 from Joseph Pecoraro <joepeck at webkit.org> ---
Sam pointed me in the right direction: Structure::toStructureShape is doing the same constructor function look up we were doing in JSC, but better.

PassRefPtr<StructureShape> Structure::toStructureShape(JSValue value)
        bool foundCtorName = false;
        if (JSObject* profilingVal = curValue.getObject()) {
            ExecState* exec = profilingVal->globalObject()->globalExec();
            PropertySlot slot(storedPrototype());
            PropertyName constructor(exec->propertyNames().constructor);
            if (profilingVal->getPropertySlot(exec, constructor, slot)) {
                if (slot.isValue()) {
                    JSValue constructorValue = slot.getValue(exec, constructor);
                    if (constructorValue.isCell()) {
                        if (JSCell* constructorCell = constructorValue.asCell()) {
                            if (JSObject* ctorObject = constructorCell->getObject()) {
                                if (JSFunction* constructorFunction = jsDynamicCast<JSFunction*>(ctorObject)) {
                                    foundCtorName = true;
                                } else if (InternalFunction* constructorFunction = jsDynamicCast<InternalFunction*>(ctorObject)) {
                                    foundCtorName = true;

        if (!foundCtorName)

This looks like something we can just plug into:

    JSValue JSInjectedScriptHost::internalConstructorName(ExecState* exec)

I'll give it a shot!

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150214/39ceb0ea/attachment-0002.html>

More information about the webkit-unassigned mailing list