Closed Bug 873591 Opened 7 years ago Closed 6 years ago

Add line numbers/filenames to JS scripts we evaluate


(Testing :: Marionette, defect)

Not set


(firefox24 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix, b2g-v1.1hd fixed)

Tracking Status
firefox24 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix
b2g-v1.1hd --- fixed


(Reporter: mdas, Assigned: jgriffin)




(1 file, 1 obsolete file)

For clearer error reporting when we're executing JS code, we might be able to take advantage of the optional arguments to evalInSandbox(, so we can pinpoint the line that's causing the JS exception.

Source for evalInSandbox if necessary:
Any chance of this landing sometime soon?
I'll take care of it in the next day or two.
Assignee: nobody → jgriffin
ok, I have a patch for this.  If you have code like this:

let a = 1;
return foo;

You'll get an error like this:

TEST-UNEXPECTED-FAIL | TestFoo.test_foo | JavascriptException: ReferenceError: foo is not defined
	execute_script, line 10
	inline javascript, line 2
	src: "return foo;"
Pushed to try:  Will flag for review if those goes green.
Attachment #765104 - Flags: review?(mdas)
Add missing changes to, document parameters to createStackMessage.  I don't really like that this has a copy of createStackMessage in both -listeners.js and -server.js, but we don't have a good place to share code between the two right now.  I guess we could create a marionette-common.js that gets loaded by both, what do you think?
Attachment #765578 - Flags: review?(mdas)
Attachment #765104 - Attachment is obsolete: true
Attachment #765104 - Flags: review?(mdas)
Attachment #765578 - Flags: review?(mdas) → review+
(In reply to Jonathan Griffin (:jgriffin) from comment #5)
>  I guess we could create a marionette-common.js that gets loaded by both, what do you think?

Oh sorry, I missed this. Sounds like it would useful enough for this case alone, so we don't need to maintain it in two files.

I'm going to ticket marionette-common.js separately.
Target Milestone: --- → mozilla24
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.