Closed Bug 278878 Opened 17 years ago Closed 6 years ago

Missing semicolon in user.js -> rest of file silently ignored

Categories

(Core :: Preferences: Backend, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: akkzilla, Assigned: milan)

References

Details

(Keywords: regression)

Attachments

(1 file)

Some of my user.js was not being picked up.  I finally narrowed it down: I had
this line

user_pref("mailnews.send_plaintext_flowed", false)

(note the lack of a semicolon) and everything after it was silently ignored:
nothing printed on stdout in a release build, nor any error popups, nor anything
in the JS console.

Isn't there some way that JS could notice a syntax error and complain about it
rather than just silently ignoring the rest of the file?
since Bug 98533, we no longer use the js engine to parse the pref files...
akk: what version of mozilla are you using?
Oh, sorry!  Should have mentioned that.  1.8a6, the m.o full installer linux
build, id 2005011116.  I don't know how new this problem is; I haven't been
changing user.js much lately until just recently when the new window prefs changed.
yeah, ok.. then this is probably a bug in the non-JS pref parser that biesi
mentioned.
Keywords: regression
(Filter "spam" on 'prefs-nobody-20080612'.)
Assignee: prefs → nobody
QA Contact: prefs
QA Contact: preferences → preferences-backend
It's been a while.  The comments above stand - we're not actually using JS engine to parse this file, it's a custom, very strict parser that we have.  The errors are only reported in the debug build, as "malformed pref file" warnings, without any additional information.  I don't see us "fixing" the parser to accept non-strict syntax, we don't recommend that people create the pref files manually.  I was about to wontfix this bug, but we should probably just promote those warnings to something that will at least show up on stdout and leave it at that.  It won't be localized, it will only show up in the console, but perhaps it's better than nothing.
Assignee: nobody → milan
Comment on attachment 8740533 [details]
MozReview Request: Bug 278878: Send preference parsing errors to browser console. r?bsmedberg

Why can't we report this to the browser console? When we parse XPCOM manifest files, I made a large effort to report to the browser console because that's where addon devs/users are most likely to see the warning.
Flags: needinfo?(milan)
Can't think of a reason :)
Attachment #8740533 - Flags: review?(benjamin)
Comment on attachment 8740533 [details]
MozReview Request: Bug 278878: Send preference parsing errors to browser console. r?bsmedberg

https://reviewboard.mozilla.org/r/45825/#review44881

Then I think we should do that. stderr printing is not useful to most people.
Attachment #8740533 - Flags: review-
Flags: needinfo?(milan)
OS: Linux → All
Comment on attachment 8740533 [details]
MozReview Request: Bug 278878: Send preference parsing errors to browser console. r?bsmedberg

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/45825/diff/1-2/
Attachment #8740533 - Attachment description: MozReview Request: Bug 278878: printf_stderr when preference file parsing fails, not just NS_WARNING. Still not too visible, but an improvement. r?bsmedberg → MozReview Request: Bug 278878: Send preference parsing errors to browser console. r?bsmedberg
Attachment #8740533 - Flags: review- → review?(benjamin)
Comment on attachment 8740533 [details]
MozReview Request: Bug 278878: Send preference parsing errors to browser console. r?bsmedberg

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/45825/diff/2-3/
Comment on attachment 8740533 [details]
MozReview Request: Bug 278878: Send preference parsing errors to browser console. r?bsmedberg

https://reviewboard.mozilla.org/r/45825/#review45599

Beautiful
Attachment #8740533 - Flags: review?(benjamin) → review+
https://hg.mozilla.org/mozilla-central/rev/be0e01e71ac3
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
See Also: → 1309175
You need to log in before you can comment on or make changes to this bug.