[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
eric at webkit.org
eric at webkit.org
Wed Jan 20 22:22:20 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 00333540df7594c9fe9a12f7c231c3c0286e2920
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