Preprocessing js files should use //@line

RESOLVED INVALID

Status

()

Firefox
Build Config
RESOLVED INVALID
5 years ago
5 years ago

People

(Reporter: Yoric, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [mentor=Yoric][lang=python])

We have a number of preprocessed JavaScript files on m-c. Unfortunately, for any of these files, any stack trace line number will be false. This is pretty annoying for debugging, especially for intermittent oranges.

Now, as it turns out, our JS VM supports directives

//@line 1234

specifically for this kind of issues.

We should adapt Preprocessor.py to introduce these directives.
I am willing to mentor this, btw.
Whiteboard: [mentor=Yoric][lang=python]
It already does that.
http://mxr.mozilla.org/mozilla-central/source/config/Preprocessor.py#132

And for example, if I look in components/FeedWriter.js in an omni.ja from a try build i did recently, I can see:
//@line 652 "e:\builds\moz2_slave\try-w32\build\browser\components\feeds\src\FeedWriter.js"
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
In that case, the preprocessor is not applied uniformly.

Experiment:
- add the following line to test_jsctypes.js.in
   throw new Error("BOOM");
- launch the test.

I added this at line 1770 and the stack displayed the error at line 1755.
I confirm that the preprocessor does its job correctly on test_jsctypes.js.in. I will continue the investigation.
For the record, the investigation moved to:
- bug 246286;
- bug 797326.
You need to log in before you can comment on or make changes to this bug.