Closed
Bug 1394556
Opened 7 years ago
Closed 7 years ago
Compile JSM/component scripts in strict mode by default
Categories
(Core :: XPConnect, enhancement)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: kmag, Assigned: kmag)
References
(Depends on 1 open bug)
Details
Attachments
(2 files)
Bug 1186409 is currently blocked on non-strict `this` boxing issues in some JSMs. At this point, we shouldn't be relying on non-strict-mode behavior, so it's probably time to just enforce strict mode on all JSM/component scripts.
Assignee | ||
Updated•7 years ago
|
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8901988 [details]
Bug 1394556: Part 1 - Fix strict mode errors in JSM scripts.
https://reviewboard.mozilla.org/r/173402/#review178782
::: services/common/kinto-offline-client.js:21
(Diff revision 1)
>
> /*
> * This file is generated from kinto.js - do not modify directly.
> */
>
> +const global = this;
This also needs to be fixed upstream. I'll file a separate PR for that.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8901988 -
Flags: review?(ehsan) → review?(dtownsend)
Attachment #8901989 -
Flags: review?(ehsan) → review?(dtownsend)
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8901988 [details]
Bug 1394556: Part 1 - Fix strict mode errors in JSM scripts.
https://reviewboard.mozilla.org/r/173402/#review179246
::: testing/specialpowers/content/SpecialPowersObserver.jsm:258
(Diff revision 2)
> }
> let createdFiles = this._createdFiles;
> try {
> let promises = [];
> aMessage.data.forEach(function(request) {
> - const filePerms = 0666; // eslint-disable-line no-octal
> + const filePerms = 0o666; // eslint-disable-line no-octal
I think you can get rid of the eslint disable here now.
Attachment #8901988 -
Flags: review?(dtownsend) → review+
Comment 7•7 years ago
|
||
mozreview-review |
Comment on attachment 8901989 [details]
Bug 1394556: Part 2 - Compile all JSM/module scripts in strict mode.
https://reviewboard.mozilla.org/r/173404/#review179252
Attachment #8901989 -
Flags: review?(dtownsend) → review+
Assignee | ||
Comment 8•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3a804c720f13b46ba5604fd59904538b44546d23
Bug 1394556: Part 1 - Fix strict mode errors in JSM scripts. r=Mossop
https://hg.mozilla.org/integration/mozilla-inbound/rev/0ab0630eec0c15b591b379454fe59344bac62290
Bug 1394556: Part 2 - Compile all JSM/module scripts in strict mode. r=Mossop
Assignee | ||
Comment 9•7 years ago
|
||
Jörg, there's a good chance this will affect Thunderbird. Look out for errors like "TypeError: this is null", "TypeError: setting a property that has only a getter", and "ReferenceError: assignment to undeclared variable"
Flags: needinfo?(jorgk)
Comment 10•7 years ago
|
||
Thanks for the heads-up, I love changes to JS (not) ;-(
Flags: needinfo?(jorgk)
Comment 11•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3a804c720f13
https://hg.mozilla.org/mozilla-central/rev/0ab0630eec0c
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Comment 12•7 years ago
|
||
(For further reference)
It is also possible to enforce strict-mode on the JSContext. We currently didn't do that. One way non-strict may sneak in is horrible stuff through Function(). The shared JSM global work still work in presence of non-strict code, but we should really avoid it to avoid potential problems.
You need to log in
before you can comment on or make changes to this bug.
Description
•