Title: [92961] trunk
Revision
92961
Author
[email protected]
Date
2011-08-12 07:50:47 -0700 (Fri, 12 Aug 2011)

Log Message

Web Inspector: expand exception properties when wrapping it as object.
https://bugs.webkit.org/show_bug.cgi?id=66035

Source/WebCore:

Use toString() value as a description for value thrown during eval.

Reviewed by Pavel Feldman.

* inspector/InjectedScriptSource.js:
(.):

LayoutTests:

Reviewed by Pavel Feldman.

* inspector/console/console-eval-global-expected.txt:
* inspector/console/console-eval-syntax-error-expected.txt:
* inspector/console/console-eval-undefined-override-expected.txt:
* inspector/extensions/extensions-eval-expected.txt:
* inspector/runtime/runtime-setPropertyValue-expected.txt:
* platform/chromium/inspector/console/console-eval-global-expected.txt:
* platform/chromium/inspector/console/console-eval-syntax-error-expected.txt:
* platform/chromium/inspector/console/console-eval-undefined-override-expected.txt:
* platform/chromium/inspector/debugger/debugger-activation-crash2-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (92960 => 92961)


--- trunk/LayoutTests/ChangeLog	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/LayoutTests/ChangeLog	2011-08-12 14:50:47 UTC (rev 92961)
@@ -1,3 +1,20 @@
+2011-08-12  Yury Semikhatsky  <[email protected]>
+
+        Web Inspector: expand exception properties when wrapping it as object.
+        https://bugs.webkit.org/show_bug.cgi?id=66035
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/console/console-eval-global-expected.txt:
+        * inspector/console/console-eval-syntax-error-expected.txt:
+        * inspector/console/console-eval-undefined-override-expected.txt:
+        * inspector/extensions/extensions-eval-expected.txt:
+        * inspector/runtime/runtime-setPropertyValue-expected.txt:
+        * platform/chromium/inspector/console/console-eval-global-expected.txt:
+        * platform/chromium/inspector/console/console-eval-syntax-error-expected.txt:
+        * platform/chromium/inspector/console/console-eval-undefined-override-expected.txt:
+        * platform/chromium/inspector/debugger/debugger-activation-crash2-expected.txt:
+
 2011-08-12  Andrei Popescu  <[email protected]>
 
         [Chromium] Rebaseline these tests on Leopard.

Modified: trunk/LayoutTests/inspector/console/console-eval-global-expected.txt (92960 => 92961)


--- trunk/LayoutTests/inspector/console/console-eval-global-expected.txt	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/LayoutTests/inspector/console/console-eval-global-expected.txt	2011-08-12 14:50:47 UTC (rev 92961)
@@ -3,5 +3,5 @@
 foo
 "fooValue"
 bar1
-Error
+ReferenceError: Can't find variable: bar1
 

Modified: trunk/LayoutTests/inspector/console/console-eval-syntax-error-expected.txt (92960 => 92961)


--- trunk/LayoutTests/inspector/console/console-eval-syntax-error-expected.txt	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/LayoutTests/inspector/console/console-eval-syntax-error-expected.txt	2011-08-12 14:50:47 UTC (rev 92961)
@@ -1,5 +1,5 @@
 Tests that evaluating an _expression_ with a syntax error in the console won't crash the browser. Bug 61194.
 
 foo().
-Error
+SyntaxError: Expected an identifier but found '}' instead
 

Modified: trunk/LayoutTests/inspector/console/console-eval-undefined-override-expected.txt (92960 => 92961)


--- trunk/LayoutTests/inspector/console/console-eval-undefined-override-expected.txt	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/LayoutTests/inspector/console/console-eval-undefined-override-expected.txt	2011-08-12 14:50:47 UTC (rev 92961)
@@ -3,5 +3,5 @@
 var x = {a:1}; x.self = x; undefined = x;
 Object
 unknownVar
-Error
+ReferenceError: Can't find variable: unknownVar
 

Modified: trunk/LayoutTests/inspector/extensions/extensions-eval-expected.txt (92960 => 92961)


--- trunk/LayoutTests/inspector/extensions/extensions-eval-expected.txt	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/LayoutTests/inspector/extensions/extensions-eval-expected.txt	2011-08-12 14:50:47 UTC (rev 92961)
@@ -7,7 +7,7 @@
 RUNNING TEST: extension_testEvalDefinesGlobalSymbols
 Evaluate: {"func":"function","variable":42} (exception: undefined)
 RUNNING TEST: extension_testEvalFailed
-Evaluate: "Error" (exception: true)
+Evaluate: "TypeError: JSON.stringify cannot serialize cyclic structures." (exception: true)
 RUNNING TEST: extension_testEvalOk
 Evaluate: {"str":"foo","num":42} (exception: undefined)
 RUNNING TEST: extension_testEvalStatement

Modified: trunk/LayoutTests/inspector/runtime/runtime-setPropertyValue-expected.txt (92960 => 92961)


--- trunk/LayoutTests/inspector/runtime/runtime-setPropertyValue-expected.txt	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/LayoutTests/inspector/runtime/runtime-setPropertyValue-expected.txt	2011-08-12 14:50:47 UTC (rev 92961)
@@ -33,5 +33,6 @@
 {
     type : "string"
     value : "exception"
+    description : "exception"
 }
 

Modified: trunk/LayoutTests/platform/chromium/inspector/console/console-eval-global-expected.txt (92960 => 92961)


--- trunk/LayoutTests/platform/chromium/inspector/console/console-eval-global-expected.txt	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/LayoutTests/platform/chromium/inspector/console/console-eval-global-expected.txt	2011-08-12 14:50:47 UTC (rev 92961)
@@ -3,5 +3,5 @@
 foo
 "fooValue"
 bar1
-ReferenceError
+ReferenceError: bar1 is not defined
 

Modified: trunk/LayoutTests/platform/chromium/inspector/console/console-eval-syntax-error-expected.txt (92960 => 92961)


--- trunk/LayoutTests/platform/chromium/inspector/console/console-eval-syntax-error-expected.txt	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/LayoutTests/platform/chromium/inspector/console/console-eval-syntax-error-expected.txt	2011-08-12 14:50:47 UTC (rev 92961)
@@ -1,5 +1,5 @@
 Tests that evaluating an _expression_ with a syntax error in the console won't crash the browser. Bug 61194.
 
 foo().
-SyntaxError
+SyntaxError: Unexpected token }
 

Modified: trunk/LayoutTests/platform/chromium/inspector/console/console-eval-undefined-override-expected.txt (92960 => 92961)


--- trunk/LayoutTests/platform/chromium/inspector/console/console-eval-undefined-override-expected.txt	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/LayoutTests/platform/chromium/inspector/console/console-eval-undefined-override-expected.txt	2011-08-12 14:50:47 UTC (rev 92961)
@@ -3,5 +3,5 @@
 var x = {a:1}; x.self = x; undefined = x;
 Object
 unknownVar
-ReferenceError
+ReferenceError: unknownVar is not defined
 

Modified: trunk/LayoutTests/platform/chromium/inspector/debugger/debugger-activation-crash2-expected.txt (92960 => 92961)


--- trunk/LayoutTests/platform/chromium/inspector/debugger/debugger-activation-crash2-expected.txt	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/LayoutTests/platform/chromium/inspector/debugger/debugger-activation-crash2-expected.txt	2011-08-12 14:50:47 UTC (rev 92961)
@@ -5,7 +5,7 @@
 Set timer for test function.
 Script execution paused.
 Call stack:
-    0)  (debugger-activation-crash2.html:11)
+    0)  (debugger-activation-crash2.html:9)
     1) testFunction (debugger-activation-crash2.html:20)
 Script execution resumed.
 Debugger was disabled.

Modified: trunk/Source/WebCore/ChangeLog (92960 => 92961)


--- trunk/Source/WebCore/ChangeLog	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/Source/WebCore/ChangeLog	2011-08-12 14:50:47 UTC (rev 92961)
@@ -1,3 +1,15 @@
+2011-08-12  Yury Semikhatsky  <[email protected]>
+
+        Web Inspector: expand exception properties when wrapping it as object.
+        https://bugs.webkit.org/show_bug.cgi?id=66035
+
+        Use toString() value as a description for value thrown during eval.
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/InjectedScriptSource.js:
+        (.):
+
 2011-08-12  Pavel Feldman  <[email protected]>
 
         Web Inspector: make folders optional in the Scripts' panel file selector.

Modified: trunk/Source/WebCore/inspector/InjectedScriptSource.js (92960 => 92961)


--- trunk/Source/WebCore/inspector/InjectedScriptSource.js	2011-08-12 14:33:34 UTC (rev 92960)
+++ trunk/Source/WebCore/inspector/InjectedScriptSource.js	2011-08-12 14:50:47 UTC (rev 92961)
@@ -1,4 +1,4 @@
-  /*
+/*
  * Copyright (C) 2007 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -284,8 +284,7 @@
             return { wasThrown: false,
                      result: this._wrapObject(func.apply(object, resolvedArgs), objectGroup, returnByValue) };
         } catch (e) {
-            return { wasThrown: true,
-                     result: this._wrapObject(e, objectGroup) };
+            return this._createThrownValue(e, objectGroup);
         }
     },
 
@@ -295,11 +294,20 @@
             return { wasThrown: false,
                      result: this._wrapObject(this._evaluateOn(evalFunction, object, _expression_, isEvalOnCallFrame, injectCommandLineAPI), objectGroup, returnByValue) };
         } catch (e) {
-            return { wasThrown: true,
-                     result: this._wrapObject(e, objectGroup) };
+            return this._createThrownValue(e, objectGroup);
         }
     },
 
+    _createThrownValue: function(value, objectGroup)
+    {
+        var remoteObject = this._wrapObject(value, objectGroup);
+        try {
+            remoteObject.description = this._toString(value);
+        } catch (e) {}
+        return { wasThrown: true,
+                 result: remoteObject };
+    },
+
     _evaluateOn: function(evalFunction, object, _expression_, isEvalOnCallFrame, injectCommandLineAPI)
     {
         // Only install command line api object for the time of evaluation.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to