***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8
This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:
ChromeUtils.import("resource://gre/modules/Services.jsm");
is approximately the same as the following, in the new model:
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs
This was done using the followng script:
https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16750
--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
If any callback fired by DebuggerClient.close ends up calling close again, it will introduce an infinite loop.
Depends on D15826
Differential Revision: https://phabricator.services.mozilla.com/D15827
--HG--
extra : moz-landing-system : lando
loadSubScript throws a string, without any stack/location.
Consider all string exceptions as coming from loadSubScript and re-throw a real error
object, coming with the stack of the require call.
Also handle wrong require path with a more explicit error message.
Differential Revision: https://phabricator.services.mozilla.com/D14139
--HG--
extra : moz-landing-system : lando
This change adds a preferences check based on the change before.
It also removes the skipping of "all" because we generate subproperties
of "all" shorthand in a platform-neutral way. That list shouldn't be
affected by any preference.
MozReview-Commit-ID: LJyxGXJxvfW
--HG--
extra : rebase_source : f5bbff12a8d17bb242e6815936e2347364302050
This change adds a preferences check based on the change before.
It also removes the skipping of "all" because we generate subproperties
of "all" shorthand in a platform-neutral way. That list shouldn't be
affected by any preference.
MozReview-Commit-ID: LJyxGXJxvfW
--HG--
extra : rebase_source : 4bf900109e9c8b4536211ace5e9cdf42fa45eb4b
Changes and notes:
- Created `devtools/client/shared/test/telemetry-test-helpers.js`, which
contains test helpers to aid in creating and running telemetry tests.
- Removed any telemetry monkeypatching as it is not dependable and no longer
needed (there is some left in GCLI but the test is now disabled because
we are removing GCLI soon anyhow).
- Because `telemetry-test-helpers.js` is imported by `shared-head.js` I
have had to make it available everywhere that shared-head.js is used.
- All telemetry tests have been rewritten to use the new helper.
- shared-head.js cannot be imported by tests inside
`devtools/client/performance/test/` because perf have custom `once` and
`waitFor` implementations that act differently from the ones inside
`shared-head.js`. This means I had to import the telemetry helpers into
`devtools/client/performance/test/head.js`
- Created `devtools/client/shared/test/browser_telemetry_misc.js` to be sure
to catch `DEVTOOLS_SCREEN_RESOLUTION_ENUMERATED_PER_USER` (we catch a few
others to be thorough).
- Disabled `browser_inspector_menu-02-copy-items.js`, which was failing to
test some expired scalars. I also corrected the way the scalars are logged
because it was completely wrong.
MozReview-Commit-ID: JjQEGM6hT61
--HG--
extra : rebase_source : cd1214d01bd11908f69167839975cd93ecb83421
This was done using the script at:
bc5629735d/processors/add-task-async.jsm?at=default&fileviewer=file-view-default
MozReview-Commit-ID: KxuS9Cen87
--HG--
extra : rebase_source : c0028e0cd55ba1643610cd30c55c6f4bca7d6e58
extra : histedit_source : ebc84fdec9c2db6176632d62de4e7bdad2a7829d
This patch was autogenerated by my decomponents.py
It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.
It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.
It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)
MozReview-Commit-ID: DeSHcClQ7cG
--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
This is a short-term solution to our inability to apply CSP to
chrome-privileged documents.
Ideally, we should be preventing all inline script execution in
chrome-privileged documents, since the reprecussions of XSS in chrome
documents are much worse than in content documents. Unfortunately, that's not
possible in the near term because a) we don't support CSP in system principal
documents at all, and b) we rely heavily on inline JS in our static XUL.
This stop-gap solution at least prevents some of the most common vectors of
XSS attack, by automatically sanitizing any HTML fragment created for a
chrome-privileged document.
MozReview-Commit-ID: 5w17celRFr
--HG--
extra : rebase_source : 1c0a1448a06d5b65e548d9f5362d06cc6d865dbe
extra : amend_source : 7184593019f238b86fd1e261941d8e8286fa4006
We would like to optimize sprintfjs for performances.
To avoid regressions, add a basic unit test taken from the original
sprintfjs repository.
MozReview-Commit-ID: IKkDHpYfL4I
--HG--
extra : rebase_source : 39837c4c6039e77c189ce9db2e12d4b7b26171c7
extra : intermediate-source : 10683284fa0d1d7cbe4c10628b7ab90eb034c8de
extra : source : d7028aeaf4fbf8cd06285746269799a7a9cc7af5
This API is only implemented as a temporary measure to ease the migration out of
sdk APIs.
MozReview-Commit-ID: BBlhxclpWqJ
--HG--
extra : rebase_source : 4de2e6ec946634acaf638777aab2589eeb5125a2
`EventEmitter` now can be used in the same way `sdk/event/core`, it also
integrates some of the SDK capabilities.
In addition the `emit` method is now unified in functionality, and is more
consistent with the nodejs counterpart (the listener doesn't receive the event
type anymore as first argument).
MozReview-Commit-ID: DNxnjwmcC4W