***
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
Marionette currently truncates a selection of log messages that
exceed 250 characters. It is however sometimes, usually when
debugging locally, to not truncate logs so one can see exactly what
is sent to and fro the server.
If val does not have a property nodeType, a warning is emitted to
the browser console. This is observable when running the xpcshell
unit tests because we mock out val without a nodeType property.
MozReview-Commit-ID: GzqMoJQQdF8
--HG--
extra : rebase_source : be793524551751e96e2059907cfc3eed3602cde5
If val does not have a property nodeType, a warning is emitted to
the browser console. This is observable when running the xpcshell
unit tests because we mock out val without a nodeType property.
MozReview-Commit-ID: GzqMoJQQdF8
--HG--
extra : rebase_source : b5b7c4ec6d48421078085cbd89b7667399c9f05b
Attr objects are returned from Node.getAttribute() and this provides
a readable string like the one offered in devtools for them.
MozReview-Commit-ID: 60Pb0AV1tjt
--HG--
extra : rebase_source : e5ae61bdeb283f635714cd6b9d422eaeb0dbf0e4
Replace direct invocations of Log.jsm with the new Marionette-specific
logger.
The patch also moves the Log.get() call to a lazy getter.
MozReview-Commit-ID: H1HoAgL2Cvs
--HG--
extra : rebase_source : 0e20a5c0100a359c8d8b627457fc178293387078
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
Enhances format.pprint to also provide pretty-printing of WindowProxy
and ChromeWindow prototypes.
Unfortunately there is no good way of testing this because
Object.prototype.toString.call always gets the underlying prototype.
MozReview-Commit-ID: 5sKzJvpWVyc
--HG--
extra : rebase_source : ca021d78a19c49ad2c2a381832d25c201ee8b2e0
Currently pprint only checks for 'id' and 'class', and adds
those to the output. Given that lots of elements might not
have those attributes a couple more should be added, which
can help to uniquly identify those.
MozReview-Commit-ID: 3thefe4oLN3
--HG--
extra : rebase_source : e9d276229a39ce5169a333ecb5b1fcc10e935d2a
Pretty-printing an object belongs more naturally to the new format module.
MozReview-Commit-ID: AfXLMPAT5ar
--HG--
extra : rebase_source : 1074febec66df49745256fc9cd04b0fecd293919
Introduces a utility that truncates strings in potentially arbitrary
object structures. This allows JSON structures that contain long
strings to be shortened with an " ..." appendix for pretty logging
when data integrity is not a vital concern.
The maximum string length is currently set to 250 characters, which
is a number I have pulled out of a hat.
MozReview-Commit-ID: 2gauOvMzBCO
--HG--
extra : rebase_source : cea57d348a61ecd11a5a9cf564ed60737923f380