Upcoming change to fixIterator function in iteratorUtils.jsm

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Upcoming change to fixIterator function in iteratorUtils.jsm

Tooru Fujisawa
Hi all.

In bug 1340947 [1], I'm working on removing legacy interface of the object returned from fixIterator function [2],
exported from iteratorUtils.jsm module [3].
The object will be no more compatible [4] with for-in loop with legacy semantics (__iterator__ hook).
That will hit some compatibility issue in some add-ons that uses fixIterator with for-in.

The object keeps compatible with iterable protocol [5] (for-of, spread, yield*, etc).
If you're using fixIterator function with for-in, please rewrite the code in the following way:

  from:
    for (x in fixIterator(obj)) ...
  to:
    for (x of fixIterator(obj)) ...

so, just replacing "in" with "of" will fix the issue :)


[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1340947
[2] https://dxr.mozilla.org/comm-central/rev/13e8fa67e60a3180c22702527f6f1079f290ce90/mailnews/base/util/iteratorUtils.jsm#60
[3] https://dxr.mozilla.org/comm-central/source/mailnews/base/util/iteratorUtils.jsm
[4] https://bugzilla.mozilla.org/attachment.cgi?id=8893744&action=diff
[5] https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol

--

arai

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Removal of nsILocalFile and other interfaces, was: Upcoming change to fixIterator function in iteratorUtils.jsm

Jörg Knobloch

In the process of streamlining their APIs for mozilla57, Mozilla core yesterday removed nsILocalFile (to be replaced with nsIFile) which will affect many add-ons. As of yesterday, those add-ons stopped working in Thunderbird Daily.

As previously advised, STEEL has also been removed. Here a list of interfaces removed last week:

nsILocalFile, steelIApplication, extIApplication, nsIEntityConverter, nsIProgrammingLanguage, nsILocaleService and friends, nsIScriptableDateFormat

Details: Bug 1347507

Removal imminent for nsIFilePicker.show().

--
Jörg Knobloch - [hidden email] - www.jorgk.com
Thunderbird Developer (Thunderbird, Compose and Mailnews Editor and MIME peer) - Member of the Thunderbird Council

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Removal of nsILocalFile and other interfaces, was: Upcoming change to fixIterator function in iteratorUtils.jsm

gNeandr-12
In reply to this post by Tooru Fujisawa
Am 07.08.17 um 15:19 schrieb Jörg Knobloch:

> In the process of streamlining their APIs for mozilla57, Mozilla core
> yesterday removed nsILocalFile (to be replaced with nsIFile) which will
> affect many add-ons. As of yesterday, those add-ons stopped working in
> Thunderbird Daily.
>
> As previously advised, STEEL has also been removed. Here a list of
> interfaces removed last week:
>
> nsILocalFile, steelIApplication, extIApplication, nsIEntityConverter,
> nsIProgrammingLanguage, nsILocaleService and friends,
> nsIScriptableDateFormat
>
> Details: Bug 1347507 <https://bugzilla.mozilla.org/show_bug.cgi?id=1347507>
>
> Removal imminent for nsIFilePicker.show().
>

With the mentioned
> Bug 1347507 - Stuff we can remove when XPCOM extensions are no longer supported
I see the following ev. critcal points which could affect a TB addon:>
Bug 1387800 - Remove [deprecated] nsIFilePicker.show()
> Bug 1147947 - Remove nsIProgrammingLanguage
> Bug 851471 - Decommission nsIDownloadManager
> Bug 1378173 - Remove Promise.jsm
> Bug 1374847 - Remove nsIPrefBranch2 and nsIPrefBranchInternal
> Bug 1350102 - Remove nsILocaleService
> Bug 1313625 - Remove nsIScriptableDateFormat [was: Deprecate nsIScriptableDateFormat]
> Bug 1347888 - Remove nsIConverterOutputStream
> Bug 1347887 - Remove nsIConverterInputStream
> Bug 1347877 - Remove nsIScriptableUnicodeConverter

Any others?
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Removal of nsILocalFile and other interfaces

Jörg Knobloch
On 08/08/2017 14:55, gNeandr wrote:

> With the mentioned
>> Bug 1347507 - Stuff we can remove when XPCOM extensions are no longer
>> supported
> I see the following ev. critcal points which could affect a TB addon:
>> Bug 1387800 - Remove [deprecated] nsIFilePicker.show() - almost xxx
>> Bug 1147947 - Remove nsIProgrammingLanguage - xxx
>> Bug 851471 - Decommission nsIDownloadManager
>> Bug 1378173 - Remove Promise.jsm
>> Bug 1374847 - Remove nsIPrefBranch2 and nsIPrefBranchInternal - xxx
>> Bug 1350102 - Remove nsILocaleService - xxx
>> Bug 1313625 - Remove nsIScriptableDateFormat - xxx
>> Bug 1347888 - Remove nsIConverterOutputStream
>> Bug 1347887 - Remove nsIConverterInputStream
>> Bug 1347877 - Remove nsIScriptableUnicodeConverter
>
> Any others?

That's the ones I consider most critical, but there are many bits and pieces flying around. For
example, today we had to replace nsIExternalProtocolService::LoadUrl with
nsIExternalProtocolService::LoadURI. All textual substitution, but you have to get it right.

I don't know what add-ons are using but as I said, most of the ones marked xxx above have already
been removed.

nsIDownloadManager has already been removed in Thunderbird, it's still used in SeaMonkey.

nsIScriptableUnicodeConverter is used so much in C-C that we will adopt it. The same goes for
Promise.jsm and equally for nsIConverter[Input|Output]Stream.

Maybe Joshua can comment on those four items.

Jörg.


_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Removal of nsILocalFile and other interfaces

Jörg Knobloch
On 08/08/2017 16:51, Jörg Knobloch wrote:
> The same goes for Promise.jsm and equally for
> nsIConverter[Input|Output]Stream.

I've just heard in https://bugzilla.mozilla.org/show_bug.cgi?id=1378173 
that the import of Promise.jsm can just be removed unless Promise.defer
is used, which we don't in C-C.

So that leaves three: the unicode converter and the I/O streams.

Jörg.

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird