Closed
Bug 715242
Opened 13 years ago
Closed 9 years ago
Add build-time syntax checking for JS files in the Fennec build
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: kats, Unassigned)
Details
Often I make a change to browser.js only to find out I had a typo somewhere when I run it. We should add some sort of JS-lint syntax checker into the build to catch dumb syntax errors faster.
Updated•13 years ago
|
Assignee: bugmail.mozilla → nobody
Component: General → Build Config
Product: Fennec Native → Core
QA Contact: general → build-config
Comment 1•13 years ago
|
||
any idea what we can do here Kats/Kyle?
Reporter | ||
Comment 2•13 years ago
|
||
I looked briefly at JSlint and their ilk but it seems they don't like the "let" keyword we use all over the place. Since that's mozilla-specific it makes sense to use SpiderMonkey to check syntax instead of some other tool. Unfortunately the latest version of SpiderMonkey (that I built from trunk) no longer has the -C option (as seen at https://developer.mozilla.org/En/SpiderMonkey/Introduction_to_the_JavaScript_shell) to compile a JS file without running it. Maybe we could use an older version of SpiderMonkey that still has the option?
Comment 3•13 years ago
|
||
Or we could just add the option back in a more useful way, or something.
The downside is that the JS shell you'd build as part of an Android build is for ARM...
Reporter | ||
Comment 4•13 years ago
|
||
True. Does rhino support mozilla-isms? That could run on any/most platforms, and presumably could do syntax checking.
Comment 5•13 years ago
|
||
For what it's worth, in bug 715498, I just brought back support for 'js -c' for "compile only".
Reporter | ||
Comment 6•13 years ago
|
||
Great, thanks! I looked at rhino and it doesn't appear to support "let" or have options for syntax checking only. js -c seems to work well, we just need to hook it into the build system.
Reporter | ||
Comment 7•9 years ago
|
||
Seems like |mach eslint| can be (ab)used to do this so I'm going to close out this bug.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•