Open
Bug 797325
Opened 12 years ago
Updated 2 years ago
Components.utils.atline should be true
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
NEW
People
(Reporter: Yoric, Unassigned)
Details
(Whiteboard: [js:p3])
Attachments
(2 files, 2 obsolete files)
1.09 KB,
patch
|
Details | Diff | Splinter Review | |
1.05 KB,
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
Experience shows that, at least in some cases, throwing an error from a file that contains //@line directives displays line numbers as if these directives were absent. Not quite sure how to best write a test. I attach a trivial patch to test_jsctypes.js.in that throws an error. The error is thrown from line 644 but the xpcshell output indicates that it is thrown from line 629. This is pretty annoying for debugging, in particular for intermittent oranges. I have had the same issues with other files on m-c, btw.
Reporter | ||
Comment 1•12 years ago
|
||
Adding Components.utils.atline = true; in head.js seems to do the trick for test_jsctypes.js.in. Note that this contradicts the MDN documentation that states that |atline| is readonly. However, doing this from within test_jsctypes.js.in does not help. Unfortunately, this is not really an acceptable solution, as it does not port to, e.g. code modules.
Reporter | ||
Updated•12 years ago
|
Summary: //@line Does not seem to be interpreted correctly → Components.utils.atline should be true
Comment 2•12 years ago
|
||
There is potential for problems with Components.utils.atline universally true. While it is always useful for tinderbox tests, it may or may not be what $user wants with Firefox builds. If you're a Firefox developer and you just built and have the corresponding source, you probably want atline = true, but if you're an occasional developer, or an addon developer, or some other kind of developer, chances are you'd like actual lines and file names of where the error is in what you have, which is the preprocessed file, and would likely prefer atline = false.
Reporter | ||
Comment 3•12 years ago
|
||
That makes sense. Perhaps we should have atline = true in debug builds, for instance.
Comment 4•12 years ago
|
||
We could add '-e "options('atline');"' to xpcshell invocations, and add an about:config pref for Firefox itself ; we could set it for mochitests.
Reporter | ||
Comment 5•12 years ago
|
||
Sounds like a plan.
Reporter | ||
Comment 6•12 years ago
|
||
Let's start with xpcshell.
Attachment #667465 -
Flags: feedback?(mh+mozilla)
Comment 7•12 years ago
|
||
Comment on attachment 667465 [details] [diff] [review] Setting Components.utils.atline = true for xpcshell tests. I think it would be better to set with -e 'options("atline")' on the xpcshell command line.
Attachment #667465 -
Flags: feedback?(mh+mozilla) → feedback-
Reporter | ||
Comment 8•12 years ago
|
||
Assignee: general → dteller
Attachment #667465 -
Attachment is obsolete: true
Attachment #667470 -
Flags: review?(mh+mozilla)
Comment 9•12 years ago
|
||
Comment on attachment 667470 [details] [diff] [review] Setting options("atline") for xpcshell tests. Review of attachment 667470 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/xpcshell/runxpcshelltests.py @@ +200,5 @@ > '-n', > '-s', > '-e', 'const _HTTPD_JS_PATH = "%s";' % self.httpdJSPath, > + '-e', 'const _HEAD_JS_PATH = "%s";' % self.headJSPath, > + '-e', "options('atline');" I'd invert the quotes for consistency. Note I'm not a peer for the test harness. Ted is.
Attachment #667470 -
Flags: review?(ted.mielczarek)
Attachment #667470 -
Flags: review?(mh+mozilla)
Attachment #667470 -
Flags: review+
Reporter | ||
Comment 10•12 years ago
|
||
Swapped quotes.
Attachment #667470 -
Attachment is obsolete: true
Attachment #667470 -
Flags: review?(ted.mielczarek)
Attachment #667480 -
Flags: review?(ted.mielczarek)
Reporter | ||
Comment 11•12 years ago
|
||
As mentioned bu glandium, bug 246286 contains what looks like a (unfortunately bitrotten) patch for the mochitest side. If anyone wants to pick it up, this would be great.
Assignee: dteller → general
Comment 12•12 years ago
|
||
Comment on attachment 667480 [details] [diff] [review] Setting options("atline") for xpcshell tests. Review of attachment 667480 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/xpcshell/runxpcshelltests.py @@ +200,5 @@ > '-n', > '-s', > '-e', 'const _HTTPD_JS_PATH = "%s";' % self.httpdJSPath, > + '-e', 'const _HEAD_JS_PATH = "%s";' % self.headJSPath, > + '-e', 'options("atline");' Seems reasonable, but maybe we should just compress these three -e arguments into one -e? '-e', 'const _HTTPD_JS_PATH = "%s"; const _HEAD_JS_PATH = "%s"; options("atline");' % (self.httpdJSPath, self.headJSPath)
Attachment #667480 -
Flags: review?(ted.mielczarek) → review+
Updated•12 years ago
|
Assignee: general → dteller
Comment 13•12 years ago
|
||
Does this bug only cover js code in tests? i.e. if I want the line numbers to match up for mobile/android/chrome/content/browser.js, should I just set Components.utils.atline=true in that file, or will this bug eventually fix that problem?
Comment 14•12 years ago
|
||
(In reply to Kartikaya Gupta (:kats) from comment #13) > Does this bug only cover js code in tests? i.e. if I want the line numbers > to match up for mobile/android/chrome/content/browser.js, should I just set > Components.utils.atline=true in that file, or will this bug eventually fix > that problem? See comment 2.
Comment 15•12 years ago
|
||
Thanks, I misunderstood that comment the first time I read through it.
Updated•12 years ago
|
Whiteboard: [js:p3]
Reporter | ||
Comment 16•10 years ago
|
||
I don't think I'll have time to work on this in any near future.
Assignee: dteller → nobody
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•