Make it easier to debug ContentTask.spawn scripts

NEW
Unassigned

Status

Testing
Mochitest
3 years ago
3 years ago

People

(Reporter: mconley, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Apparently, ContentTask.spawn scripts, when they throw exceptions, don't have a correct mapping between the line numbers in the stack for the eval'd function, and the actual line throwing the exception.

We should also make sure that things like "info()" are available to ContentTask.spawn scripts.

Also, if there was a way to debug these things with the JS debugger, that'd be amazing.
Cc'ing smacleod. I know he's not working on this stuff anymore, but he might have input regardless.
(In reply to Mike Conley (:mconley) - Needinfo me! from comment #0)
> Apparently, ContentTask.spawn scripts, when they throw exceptions, don't
> have a correct mapping between the line numbers in the stack for the eval'd
> function, and the actual line throwing the exception.
Since we're just turning the function definition into a string and shooting it
down to content in a message it has no way to figure out the old line numbers.
We might be able to send down extra information and do some magic to make things
look correct but I have no idea how much effort that would be.

I'm not opposed to any improvements here, but I don't really have insights into
the best way to accomplish them.
You need to log in before you can comment on or make changes to this bug.