[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

yurys at chromium.org yurys at chromium.org
Thu Feb 4 21:29:44 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 2dfe882173a0e06c45999c846698e7d4dd179204
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 27 19:30:19 2010 +0000

    2010-01-27  Yury Semikhatsky  <yurys at 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.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53945 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 78fc268..04d5de6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-01-27  Yury Semikhatsky  <yurys at 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.
+
 2010-01-27 Anton Muhin <antonm at google.com>
         Review by Adam Barth.
 
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index a7836b0..9cf9bf0 100644
--- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -126,6 +126,19 @@ JSValue JSInjectedScriptHost::currentCallFrame(ExecState* exec, const ArgList&)
     return toJS(exec, callFrame);
 }
 
+JSValue JSInjectedScriptHost::isActivation(ExecState* exec, const ArgList& args)
+{
+    if (args.size() < 1)
+        return jsUndefined();
+
+    JSValue value = args.at(0);
+    if (!value.isObject())
+        return jsBoolean(false);
+
+    JSObject* object = value.toObject(exec);
+    return jsBoolean(object->isActivationObject());
+}
+
 #endif
 
 JSValue JSInjectedScriptHost::nodeForId(ExecState* exec, const ArgList& args)
diff --git a/WebCore/inspector/InjectedScriptHost.idl b/WebCore/inspector/InjectedScriptHost.idl
index f9abad7..d224d1a 100644
--- a/WebCore/inspector/InjectedScriptHost.idl
+++ b/WebCore/inspector/InjectedScriptHost.idl
@@ -43,6 +43,7 @@ module core {
 
 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
         [Custom] DOMObject currentCallFrame();
+        [Custom] boolean isActivation(in DOMObject object);
 #endif
 
 #if defined(ENABLE_DATABASE) && ENABLE_DATABASE
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index 0b34b9c..9389117 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -1182,7 +1182,7 @@ InjectedScript.CallFrameProxy.prototype = {
             var scopeObject = scopeChain[i];
             var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i }, true);
 
-            if (Object.prototype.toString.call(scopeObject) === "[object JSActivation]") {
+            if (InjectedScriptHost.isActivation(scopeObject)) {
                 if (!foundLocalScope)
                     scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true }, true);
                 else
diff --git a/WebCore/manual-tests/inspector/debugger-scopes-inspection.html b/WebCore/manual-tests/inspector/debugger-scopes-inspection.html
new file mode 100644
index 0000000..f06b3e7
--- /dev/null
+++ b/WebCore/manual-tests/inspector/debugger-scopes-inspection.html
@@ -0,0 +1,35 @@
+<script>
+
+var obj = {
+  objField: 30
+};
+
+function handleLoad(e) {
+  new C().m();
+}
+
+function C() {
+  this.a = 10;
+  this.timestamp = Date.now();
+}
+
+C.prototype.m = function() {
+  this.timestamp = Date.now();
+  with (obj) {
+    debugger;
+    objField++;
+  }
+  var self = this;
+  setTimeout(function() {
+       self.m();
+     }, 1000);
+};
+
+
+</script>
+<body onload="handleLoad(event)">
+
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=34161"> Bug 34161 -  Local scope is shown as With scope in scope chain pane </a>.</p>
+<p>To test, open the Inspector and start a debugging session. In a second debugger will pause. While paused look at scope chain pane. There should be three scopes: 'With scope' containing objField variable, 'Local scope' with this and self variables and 'Global scope'. All scopes but 'Global' should be expanced. 'Global' scope should be collapsed(it takes too long to expand DOMWindow so we prefer to do it on demand). </p>
+</body>
+

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list