[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 01:03:38 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 71a8b90462ceb81cd12efe45c5610d8ac62b35d7
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 13 18:14:16 2010 +0000

    2010-01-13  Kent Hansen  <kent.hansen at nokia.com>
    
            Reviewed by Timothy Hatcher.
    
            Some objects in the global scope are not completed
            https://bugs.webkit.org/show_bug.cgi?id=19119
    
            Use Object.getOwnPropertyNames instead of for-in to provide completions, since
            Object.getOwnPropertyNames reports both enumerable and non-enumerable properties.
    
            * inspector/front-end/InjectedScript.js:
            (InjectedScript._getPropertyNames):
            (InjectedScript.getCompletions):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53192 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 47f7e28..e5a83b6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-13  Kent Hansen  <kent.hansen at nokia.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Some objects in the global scope are not completed
+        https://bugs.webkit.org/show_bug.cgi?id=19119
+
+        Use Object.getOwnPropertyNames instead of for-in to provide completions, since
+        Object.getOwnPropertyNames reports both enumerable and non-enumerable properties.
+
+        * inspector/front-end/InjectedScript.js:
+        (InjectedScript._getPropertyNames):
+        (InjectedScript.getCompletions):
+
 2010-01-13  Ben Murdoch  <benm at google.com>
 
         Reviewed by Simon Hausmann.
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index e47522c..f8150fa 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -533,6 +533,18 @@ InjectedScript.setOuterHTML = function(nodeId, value, expanded)
     return InjectedScriptHost.pushNodePathToFrontend(newNode, expanded, false);
 }
 
+InjectedScript._getPropertyNames = function(object, resultSet)
+{
+    for (var o = object; o; o = o.__proto__) {
+        try {
+            var names = Object.getOwnPropertyNames(o);
+            for (var i = 0; i < names.length; ++i)
+                resultSet[names[i]] = true;
+        } catch (e) {
+        }
+    }
+}
+
 InjectedScript.getCompletions = function(expression, includeInspectorCommandLineAPI, callFrameId)
 {
     var props = {};
@@ -548,23 +560,16 @@ InjectedScript.getCompletions = function(expression, includeInspectorCommandLine
             else {
                 // Evaluate into properties in scope of the selected call frame.
                 var scopeChain = callFrame.scopeChain;
-                for (var i = 0; i < scopeChain.length; ++i) {
-                    var scopeObject = scopeChain[i];
-                    try {
-                        for (var propertyName in scopeObject)
-                            props[propertyName] = true;
-                    } catch (e) {
-                    }
-                }
+                for (var i = 0; i < scopeChain.length; ++i)
+                    InjectedScript._getPropertyNames(scopeChain[i], props);
             }
         } else {
             if (!expression)
                 expression = "this";
             expressionResult = InjectedScript._evaluateOn(InjectedScript._window().eval, InjectedScript._window(), expression);
         }
-        if (expressionResult)
-            for (var prop in expressionResult)
-                props[prop] = true;
+        if (typeof expressionResult == "object")
+            InjectedScript._getPropertyNames(expressionResult, props);
         if (includeInspectorCommandLineAPI)
             for (var prop in InjectedScript._window().console._inspectorCommandLineAPI)
                 if (prop.charAt(0) !== '_')

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list