Debugger statement in Scratchpad

NEW
Unassigned

Status

()

Firefox
Developer Tools: Scratchpad
P3
enhancement
5 years ago
25 days ago

People

(Reporter: espadrine, Unassigned)

Tracking

Trunk
All
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Steps to reproduce:

1. Open the Browser Debugger.
2. Open the Scratchpad.
3. Paste the following bit of code in there:
   (function foo(a, b) { var c = a + b; debugger; return c; }(1, 2));
4. Run it.

What I expected:
The Browser Debugger should show the contents of the Scratchpad.

What happens instead:
The Browser Debugger shows the following content for "Scratchpad/1": "Loading…"
It starts debugging. The stacks are displayed correctly. Yet, no JS is displayed.
This is because scratchpad uses evalInSandbox, passing a dummy Scratchpad/n filename and a line number of 1. We did this to make console.log and friends look intuitive to web developers who don't know about Firefox internals. Perhaps now the Browser Debugger provides a compelling argument for sending the correct source location, and maybe getting the web console to convert "scratchpad.js:330" to "Scratchpad:1" if we think it's important.
Component: Developer Tools: Debugger → Developer Tools: Scratchpad
Created attachment 685616 [details] [diff] [review]
Dummy filename removal

Here is a patch to try out. Note that it breaks bug 661762 as it is.
Depends on: 637572
Priority: -- → P3
Duplicate of this bug: 898083
cc'ing Eddy. I think he mentioned taking a look at this during the work week.
Severity: normal → enhancement
You need to log in before you can comment on or make changes to this bug.