Closed Bug 887895 Opened 11 years ago Closed 9 years ago

[meta] Remove SpiderMonkey specific JS syntax from the devtools

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bbenvie, Unassigned)

References

Details

(Keywords: meta)

Attachments

(2 files)

Anything syntax extensions that are specific to SpiderMonkey should be removed from devtools code. This will allow third party tools, which mostly do not and will not support these extensions, to be used while developing the devtools. This will also open the future possibility of reusing some devtools code in other JS engines, e.g. a Node.js client. The main offender is expression closures, which are used liberally throughout the devtools. `for each` is also used in a few places. This is a meta bug because I'd like to roll this out tool by tool or file by file to prevent having a mega-patch constantly being bitrotted.
Blocks: 825800
Depends on: 862849
Depends on: 896035
Depends on: 896041
Attached file syntax-errors.txt (deleted) —
Running eslint with *all* rules turned off, and with es6 mode ON leads to about 280 syntax errors encountered by the parser in eslint (Espree). These are all things that spidermonkey accepts but that are non-standard. In this list, a lot of them are yield inside functions that do have the * character normally required for generator functions. Another bunch are getters without braces: get something() "something"; There's a few instances of [x for (x of list)] too. These parsing errors prevent eslint from properly running on these files. It'd be great if we could split this list into child bugs and fix these once and for all. Bug 1166189 will introduce eslint configuration files in the devtools code, so hopefully, we should not introduce new instances of these afterwards.
Depends on: 1167617
(In reply to Brandon Benvie [:benvie] from comment #0) > Anything syntax extensions that are specific to SpiderMonkey should be > removed from devtools code. This will allow third party tools, which mostly > do not and will not support these extensions, to be used while developing > the devtools. This will also open the future possibility of reusing some > devtools code in other JS engines, e.g. a Node.js client. Spidermonkey is trying to eliminate support for all nonstandard syntax, so this will help eliminate blockers to that effort as well.
Depends on: 1167704
Depends on: 1167945
Blocks: 1166189
Depends on: 1167957
Depends on: 1167979
Depends on: 1168077
Depends on: 1168088
Attached file eslintrc-all-off.json (deleted) —
For info, here's what I've been doing to track these: - install eslint (npm install -g eslint) - download the attached eslintrc configuration file - run: eslint -c path/to/config path/to/directory/to/check The config has es6 mode turned ON and *all* rules turned off, so eslint will only complain about the files it couldn't parse.
All dependencies are resolved, so it looks like we can now close this?
Flags: needinfo?(pbrosset)
\o/ closing now \o/
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(pbrosset)
Resolution: --- → FIXED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: