[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-34-g43a6bb2
Gustavo Noronha Silva
gustavo.noronha at collabora.co.uk
Wed Oct 7 06:26:08 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 4651752592c22022fa43d63e843a4265f87d9870
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 21 21:37:16 2009 +0000
2009-09-21 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Timothy Hatcher.
Web Inspector: Evaluating on call frame always returns "undefined".
https://bugs.webkit.org/show_bug.cgi?id=29613
* inspector/front-end/InjectedScript.js:
(InjectedScript.evaluate):
(InjectedScript._evaluateAndWrap):
(InjectedScript._evaluateOn):
(InjectedScript.evaluateInCallFrame):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8dbb019..34eafb2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2182,6 +2182,20 @@
Reviewed by Timothy Hatcher.
+ Web Inspector: Evaluating on call frame always returns "undefined".
+
+ https://bugs.webkit.org/show_bug.cgi?id=29613
+
+ * inspector/front-end/InjectedScript.js:
+ (InjectedScript.evaluate):
+ (InjectedScript._evaluateAndWrap):
+ (InjectedScript._evaluateOn):
+ (InjectedScript.evaluateInCallFrame):
+
+2009-09-21 Pavel Feldman <pfeldman at chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
Web Inspector: Exception formatting is broken in console.
https://bugs.webkit.org/show_bug.cgi?id=29608
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index ba38385..4d96f68 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -515,26 +515,20 @@ InjectedScript.getCompletions = function(expression, includeInspectorCommandLine
return props;
}
-
InjectedScript.evaluate = function(expression)
{
+ return InjectedScript._evaluateAndWrap(InjectedScript._window().eval, InjectedScript._window(), expression);
+}
+
+InjectedScript._evaluateAndWrap = function(evalFunction, object, expression)
+{
var result = {};
try {
- var value = InjectedScript._evaluateOn(InjectedScript._window().eval, InjectedScript._window(), expression);
- if (value === null)
- return { value: null };
- if (Object.type(value) === "error") {
- result.value = InspectorController.wrapObject(value);
+ result.value = InspectorController.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression));
+ // Handle error that might have happened while describing result.
+ if (result.value.errorText) {
+ result.value = InspectorController.wrapObject(result.value.errorText);
result.isException = true;
- return result;
- }
-
- var wrapper = InspectorController.wrapObject(value);
- if (wrapper.errorText) {
- result.value = InspectorController.wrapObject(wrapper.errorText);
- result.isException = true;
- } else {
- result.value = wrapper;
}
} catch (e) {
result.value = InspectorController.wrapObject(e.toString());
@@ -549,7 +543,13 @@ InjectedScript._evaluateOn = function(evalFunction, object, expression)
// Surround the expression in with statements to inject our command line API so that
// the window object properties still take more precedent than our API functions.
expression = "with (window._inspectorCommandLineAPI) { with (window) { " + expression + " } }";
- return evalFunction.call(object, expression);
+ var value = evalFunction.call(object, expression);
+
+ // When evaluating on call frame error is not thrown, but returned as a value.
+ if (Object.type(value) === "error")
+ throw value.toString();
+
+ return value;
}
InjectedScript.addInspectedNode = function(nodeId)
@@ -826,7 +826,7 @@ InjectedScript.evaluateInCallFrame = function(callFrameId, code)
var callFrame = InjectedScript._callFrameForId(callFrameId);
if (!callFrame)
return false;
- return InjectedScript._evaluateOn(callFrame.evaluate, callFrame, code);
+ return InjectedScript._evaluateAndWrap(callFrame.evaluate, callFrame, code);
}
InjectedScript._callFrameForId = function(id)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list