Changeset 53945 in webkit


Ignore:
Timestamp:
Jan 27, 2010 11:30:19 AM (14 years ago)
Author:
yurys@chromium.org
Message:

2010-01-27 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Oliver Hunt.

Instead of relying on Object.prototype.toString result use JSObject::isActivationObject
to check if a scope node is a JSActivation. Object.prototype.toString for JSActivation
will call JSActivation::toThisObject whose result depends on the current call stack.

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

Test: WebCore/manual-tests/inspector/debugger-scopes-inspection.html

  • bindings/js/JSInjectedScriptHostCustom.cpp: (WebCore::JSInjectedScriptHost::isActivation):
  • inspector/InjectedScriptHost.idl:
  • inspector/front-end/InjectedScript.js: (injectedScriptConstructor.):
  • manual-tests/inspector/debugger-scopes-inspection.html: Added.
Location:
trunk/WebCore
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53944 r53945  
     12010-01-27  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Instead of relying on Object.prototype.toString result use JSObject::isActivationObject
     6        to check if a scope node is a JSActivation. Object.prototype.toString for JSActivation
     7        will call JSActivation::toThisObject whose result depends on the current call stack.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=34161
     10
     11        Test: WebCore/manual-tests/inspector/debugger-scopes-inspection.html
     12
     13        * bindings/js/JSInjectedScriptHostCustom.cpp:
     14        (WebCore::JSInjectedScriptHost::isActivation):
     15        * inspector/InjectedScriptHost.idl:
     16        * inspector/front-end/InjectedScript.js:
     17        (injectedScriptConstructor.):
     18        * manual-tests/inspector/debugger-scopes-inspection.html: Added.
     19
    1202010-01-27 Anton Muhin <antonm@google.com>
    221        Review by Adam Barth.
  • trunk/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp

    r53766 r53945  
    127127}
    128128
     129JSValue JSInjectedScriptHost::isActivation(ExecState* exec, const ArgList& args)
     130{
     131    if (args.size() < 1)
     132        return jsUndefined();
     133
     134    JSValue value = args.at(0);
     135    if (!value.isObject())
     136        return jsBoolean(false);
     137
     138    JSObject* object = value.toObject(exec);
     139    return jsBoolean(object->isActivationObject());
     140}
     141
    129142#endif
    130143
  • trunk/WebCore/inspector/InjectedScriptHost.idl

    r53766 r53945  
    4444#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
    4545        [Custom] DOMObject currentCallFrame();
     46        [Custom] boolean isActivation(in DOMObject object);
    4647#endif
    4748
  • trunk/WebCore/inspector/front-end/InjectedScript.js

    r53807 r53945  
    11831183            var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i }, true);
    11841184
    1185             if (Object.prototype.toString.call(scopeObject) === "[object JSActivation]") {
     1185            if (InjectedScriptHost.isActivation(scopeObject)) {
    11861186                if (!foundLocalScope)
    11871187                    scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true }, true);
Note: See TracChangeset for help on using the changeset viewer.