Closed Bug 1109692 Opened 10 years ago Closed 10 years ago

Make evaluations that throw faster when an object preview is available

Categories

(DevTools Graveyard :: Scratchpad, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 37

People

(Reporter: past, Assigned: past)

Details

Attachments

(1 file, 1 obsolete file)

When evaluating a scratchpad that throws, we make one or two additional requests to the server to retrieve the exception's properties and displayString. Most of the time however, the required data is present in the evaluateJS response packet as a preview, and the extra requests can be avoided.
This patch makes writeAsErrorComment use the object preview if available, so that the extra requests are omitted. It also fixes a couple of other minor issues and, more importantly, allows Valence to display stack traces in these cases, as error objects in Chrome don't have properties with location information (file, line, column).
Attachment #8534390 - Flags: review?(nfitzgerald)
Removed a redundant check.
Attachment #8534396 - Flags: review?(nfitzgerald)
Attachment #8534390 - Attachment is obsolete: true
Attachment #8534390 - Flags: review?(nfitzgerald)
Comment on attachment 8534396 [details] [diff] [review]
Make Scratchpad's evaluations that throw faster v2

Review of attachment 8534396 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/devtools/scratchpad/test/browser_scratchpad_eval_func.js
@@ +15,5 @@
>    content.location = "data:text/html;charset=utf8,test Scratchpad eval function.";
>  }
>  
>  function reportErrorAndQuit(error) {
> +  const {DevToolsUtils} = Cu.import("resource://gre/modules/devtools/DevToolsUtils.jsm", {});

Might as well throw this in head.js, its going to be useful in general for many tests. Surprised it's not there already.
Attachment #8534396 - Flags: review?(nfitzgerald) → review+
https://hg.mozilla.org/mozilla-central/rev/7ff9e2fcc572
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
Product: Firefox → DevTools
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: