If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Make evaluations that throw faster when an object preview is available

RESOLVED FIXED in Firefox 37

Status

()

Firefox
Developer Tools: Scratchpad
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: past, Assigned: past)

Tracking

Trunk
Firefox 37
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

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.
Created attachment 8534390 [details] [diff] [review]
Make Scratchpad's evaluations that throw faster

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)
Created attachment 8534396 [details] [diff] [review]
Make Scratchpad's evaluations that throw faster v2

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/integration/fx-team/rev/7ff9e2fcc572
https://hg.mozilla.org/mozilla-central/rev/7ff9e2fcc572
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
You need to log in before you can comment on or make changes to this bug.