Commit Graph

83 Commits

Author SHA1 Message Date
Kris Maglione
856fa07b17 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
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
2019-01-17 10:18:31 -08:00
Kris Maglione
f071009f5f Bug 1484496: Part 5b - Convert toolkit/ nsISimpleEnumerator users to use JS iteration. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D3730
2018-08-18 19:27:50 -07:00
manikishan
02874947cf Bug 1431050 - Replace NS_ASSERT with conditional exceptions/console.assert and remove the debug.js module. r=mak
console.assert keeps the same semantics as NS_ASSERT in that it doesn't throw an exception,
but a lot of the places code was using it in a way that would be better served by throwing
an exception when the condition is false.

MozReview-Commit-ID: DEF5HSfYO36
2018-02-03 11:32:25 +05:30
Florian Quèze
f6add2cafd Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Kris Maglione
0bb74efdf1 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Cosmin Sabou
f09d6d985d Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione
fd67f090b2 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Brindusan Cristian
483ba301cb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione
683a97d172 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Mark Banner
db52bd005a Bug 1422720 - Remove unused functions from globalOverlay.js (goSetMenuValue, goSetAccessKey, goOnEvent, setTooltipText). r=florian
MozReview-Commit-ID: IVmDb34wxdi
2018-01-16 23:16:39 +00:00
Mark Banner
62d89b0f75 Bug 1417940 - Change various instances of manually calling getService to use Services.jsm in toolkit/. r=mossop
MozReview-Commit-ID: 8eEhjFZc4mT
2017-11-09 16:36:57 +00:00
Andreea Pavel
4d905c03dd Backed out 1 changesets (bug 1417940) for failing browser-chrome browser/components/contextualidentity/test/browser/browser_aboutURLs.js r=backout on a CLOSED TREE
Backed out changeset 2c2f807e23b5 (bug 1417940)
2017-11-17 18:08:45 +02:00
Mark Banner
0841e15072 Bug 1417940 - Change various instances of manually calling getService to use Services.jsm in toolkit/. r=mossop
MozReview-Commit-ID: 8eEhjFZc4mT
2017-11-09 16:36:57 +00:00
Andrew McCreight
5e5e5b9abb Bug 1363215 - Replace calls to __define{Getter,Setter}__ on top-level this with Object.defineProperty. r=Gijs
__define{Getter,Setter}__ are deprecated, and are not defined on
NonSyntacticVariablesObjects, so these calls get in the way of sharing
globals between different .jsms. Probably only the DownloadUtils.jsm
change is really needed for that.

configurable and enumerable are both set to true to match the existing
behavior. If enumerable is set to false, then tests fail, because some
of the getters overwrite the getter with a regular property.

MozReview-Commit-ID: 1OZF45fIAQ
2017-05-08 14:07:34 -07:00
Jared Wein
0ec522d5b6 Bug 1331661 - Enable the 'quotes' rule for eslint and fix most of the errors with --fix. r=Gijs
MozReview-Commit-ID: 6tv0Z06CO4a
2017-01-17 09:48:17 -06:00
Mark Banner
ac52569fff Bug 1329614 - [eslint] Catch more cases of importing globals from 'var foo = Cu.import('...');'. r=jaws
MozReview-Commit-ID: 5NKHHb70YA6
2017-01-09 10:12:26 +00:00
Jared Wein
242ab87626 Bug 1326511 - Enable brace-style and no-multi-spaces eslint rules for toolkit. r=MattN
MozReview-Commit-ID: FuVu8skcqOe
2016-12-30 21:47:25 -05:00
Dave Townsend
a2ba043d69 Bug 1245649: Turn on no-trailing-spaces. r=Gijs 2016-02-03 14:22:33 -08:00
Dave Townsend
b19bb45e95 Bug 1230839 - Fix mixing reference to AppConstants in globalOverlay.js r=MattN 2015-12-07 16:21:45 -08:00
Dave Townsend
d4e176e2b1 Bug 1229519: Fix toolkit/content to pass eslint checks. r=MattN 2015-12-03 10:02:22 -08:00
Michael Layzell
f6359d6641 Bug 1170531 - Disable clipboard menu commands correctly in non-(X)HTML documents; r=ehsan 2015-06-30 08:18:04 -04:00
Ehsan Akhgari
012e2885a3 Backout changeset d648becaa638 (bug 1170531) for test failures 2015-06-27 13:14:06 -07:00
Michael Layzell
81dc87931a Bug 1170531 - Disable clipboard menu commands correctly in non-(X)HTML documents; r=ehsan 2015-06-27 12:37:44 -07:00
Carsten "Tomcat" Book
89aedf7cca Backed out changeset 3fca18104696 (bug 1170531) for e10s-m4 test failures in test_bug1067255.html 2015-06-22 15:21:02 +02:00
Michael Layzell
08190db788 Bug 1170531 - Disable clipboard menu commands correctly in non-(X)HTML documents; r=ehsan 2015-06-22 08:13:26 -04:00
Michael Layzell
5c3e68d663 Bug 1159490 - Allow cut/copy event dispatch unconditionally in HTML documents. r=neil 2015-05-13 08:44:00 +02:00
Gijs Kruitbosch
7bb02017d4 Bug 1127394 - should be able to close single tab through tabclose button even if we said 'stay on page' initially, r=jaws 2015-01-30 19:54:37 +00:00
Gijs Kruitbosch
afab08a9f7 Bug 1103203 - rm visitLink, r=jaws 2014-11-24 15:15:40 +00:00
Boris Zbarsky
9e19b54145 Bug 913855. Fix consumers of window mediator to be more consistent in their checking for closed windows. r=dolske
Note that we can't just stop returning closed windows from the window
mediator, because some consumers (e.g. session restore) rely on seeing
closed windows in the list so they can remove them from their internal
data structures expeditiouly.
2013-09-13 17:29:51 -04:00
Boris Zbarsky
c3968d7813 Bug 792215. Convert quickstubs to using JSNative getters and setters. r=peterv 2012-09-25 14:44:40 -04:00
Saurabh Anand
68a7045f60 Bug 722994 - globalOverlay.js uses global Private Browsing state to control display of a prompt; r=ehsan 2012-06-27 15:14:45 +05:30
Phil Ringnalda
2f2547a387 Back out fe2fdd5d3aae (bug 722994) for mochitest-chrome failures 2012-06-18 22:18:33 -07:00
Saurabh Anand
fb4bd379b7 Bug 722994 - globalOverlay.js uses global Private Browsing state to control display of a prompt; r=ehsan 2012-06-19 01:57:26 +05:30
Gervase Markham
cb6a072c2a Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Vivien Nicolas
2d7392a778 Bug 748889 - Silent a warning about an undefined @mozilla.org/privatebrowsing. r=enndeakin 2012-05-04 20:05:40 +02:00
Paul O’Shannessy
1fc71d3698 Bug 629485 - Show close window warning when closing the last window [r=gavin, a=blocking2.0:betaN+] 2011-02-07 17:50:37 -08:00
Dave Townsend
c407cb6573 Backed out changeset 405a715a4d81 from bug 502307 due to test failures 2009-08-19 10:38:09 +01:00
Ehsan Akhgari
9caca48aa2 Bug 502307 - Closing multiple tabs in the last browser window with Private Browsing enabled yields no warning regardless of preference setting (further fix); r=enndeakin,dao ui-r=faaborg 2009-08-19 11:16:08 +04:30
Ehsan Akhgari
c248efb27e Bug 506126 - globalOverlay.js is full of caller-less functions; r=enndeakin 2009-08-02 22:23:19 +04:30
Ehsan Akhgari
1e7bc06916 Bug 502307 - Closing multiple tabs in the last browser window with Private Browsing enabled yields no warning regardless of preference setting; r=enndeakin 2009-07-17 23:08:22 +04:30
Ehsan Akhgari
f9bc6c2dba Bug 502357 - closeWindow does unneeded work on Mac. r=enn 2009-07-13 19:37:29 +02:00
Magnus Melin
f4ce87eb07 Bug 490150: report what the exception was when command updating failed. r=gavin 2009-04-26 13:38:22 +03:00
93b09ca5b2 Bug 384370 - use JSON as the on disk, lossless format for our bookmark backup (r=mano) 2008-03-13 12:25:49 -07:00
0781141317 backing out test checkin of bug 384370 2008-03-04 14:12:27 -08:00
6da087308d TESTING - temp checkin of bug 384370 (r=mconnor) 2008-03-04 13:23:04 -08:00
9b9e2aedff backing out bug 384370 for hosation of Ts 2008-02-29 09:29:58 -08:00
4ea67490b4 Bug 384370 - use JSON as the on disk, lossless format for our bookmark backup (take two, r=mano, a=beltzner) 2008-02-29 08:39:13 -08:00
083ba1ff68 backing out bug 384370, caused 25ms Ts regression on linux, and leaks on linux and mac 2008-02-27 11:05:52 -08:00
d088f39bf8 Bug 384370 - use JSON as the on disk, lossless format for our bookmark backup (r=mano) 2008-02-27 10:14:13 -08:00
c46c1c2951 Bug 386810, Move quit-application-granted notification to nsAppStartup::Quit, r=benjamin 2007-08-09 20:05:53 -07:00