Port |Bug 1102219 - Rename String.prototype.contains to String.prototype.includes| to comm-central

RESOLVED FIXED in Thunderbird 40.0

Status

defect
--
major
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: clokep, Assigned: aryx)

Tracking

unspecified
Thunderbird 40.0
Dependency tree / graph

Thunderbird Tracking Flags

(thunderbird39 unaffected, thunderbird40 fixed)

Details

Attachments

(8 attachments)

Reporter

Description

5 years ago
Bug 1102219 will bust us, it just landed on mozilla-inbound. I couldn't find a bug about porting this to TB/IB/SM. Figured Archaeopteryx might know what needs to be done for this...
Assignee: nobody → archaeopteryx
Status: NEW → ASSIGNED

Comment 1

5 years ago
(In reply to Patrick Cloke [:clokep] from comment #0)
> Bug 1102219 will bust us, it just landed on mozilla-inbound.
No it won't. What will really break comm-central is Bug 1103588
Blocks: 1103588
No longer blocks: 1102219
Depends on: 1102219
Reporter

Comment 2

5 years ago
(In reply to Philip Chee from comment #1)
> (In reply to Patrick Cloke [:clokep] from comment #0)
> > Bug 1102219 will bust us, it just landed on mozilla-inbound.
> No it won't. What will really break comm-central is Bug 1103588

Yeah, we discussed this on IRC. Not a big deal though, we still need to fix it.
Bug 1102219 jut landed on m-c again, and the tests are pretty much busted since we check for "errors" in the console, and now there is the deprecation warning.


"CONSOLE_MESSAGE: (warn) [JavaScript Warning: "String.prototype.contains() is deprecated and will be removed in a future release; use String.prototype.includes() instead" {file: "resource://testing-common/mailnews/imapd.js" line: 1427}]"
Error console says [stackFrame String.prototype.contains() is deprecated and will be removed in a future release; use String.prototype.includes() instead]
../../../../mailnews/resources/logHelper.js:_errorConsoleTunnel.observe:95
/opt/comm-central/src/mozilla/testing/xpcshell/head.js:_do_main:207
/opt/comm-central/src/mozilla/testing/xpcshell/head.js:_execute_test:513
-e:null:1
null:null:0
exiting test
Comment hidden (Legacy TBPL/Treeherder Robot)
Patches pushed to Try: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=12b350264325

Will request reviews tomorrow morning if they pass.
Posted patch mailnews, v1Splinter Review
Attachment #8600281 - Flags: review?(mkmelin+mozilla)
Posted patch mail, v1Splinter Review
Attachment #8600282 - Flags: review?(mkmelin+mozilla)

Comment 13

4 years ago
Comment on attachment 8600279 [details] [diff] [review]
chat, v1

Review of attachment 8600279 [details] [diff] [review]:
-----------------------------------------------------------------

::: chat/protocols/irc/ircCommands.jsm
@@ +284,5 @@
>      name: "mode",
>      get helpString() _("command.modeUser", "mode") + "\n" +
>                       _("command.modeChannel", "mode"),
>      run: function(aMsg, aConv) {
> +      function isMode(aString) "+-".includes(aString[0]);

Can I ask you to change this to 

let isMode = aString => "+-".includes(aString[0]);

while you are at it, or we'll just get a different warning? Looks like this line was overlooked in the recent removal of this kind of deprecated short function definiton.

Comment 15

4 years ago
Comment on attachment 8600279 [details] [diff] [review]
chat, v1

Review of attachment 8600279 [details] [diff] [review]:
-----------------------------------------------------------------

You can ignore my previous comment, as it seems the removal of expression closures hasn't landed yet for /chat.
Attachment #8600279 - Flags: review?(aleth) → review+
Attachment #8600278 - Flags: review?(philipp) → review+

Comment 16

4 years ago
(In reply to Archaeopteryx [:aryx] from comment #11)
> Created attachment 8600283 [details] [diff] [review]
> suite/browser, v1

Isn't there some in suite/browser/navigator.js?
Flags: needinfo?(archaeopteryx)

Comment 17

4 years ago
(In reply to Archaeopteryx [:aryx] from comment #12)
> Created attachment 8600284 [details] [diff] [review]
> suite/common, v1

Isn't there some in:
suite/common/downloads/downloadmanager.js
suite/common/search/search.xml
suite/common/sidebar/sidebarOverlay.js

Updated

4 years ago
Attachment #8600280 - Flags: review?(iann_bugzilla) → review+

Comment 18

4 years ago
Comment on attachment 8600286 [details] [diff] [review]
suite/mailnews, v1

Stealing, r=me
Attachment #8600286 - Flags: review?(neil) → review+
(In reply to Ian Neal from comment #16)
> (In reply to Archaeopteryx [:aryx] from comment #11)
> > Created attachment 8600283 [details] [diff] [review]
> > suite/browser, v1
> 
> Isn't there some in suite/browser/navigator.js?

None of them are strings:
> line 694 -- if (!next || !next.classList.contains("nav-bar-class"))
> line 697 -- if (!previous || !previous.classList.contains("nav-bar-class"))
classLists

> line 2132 -- if (!title || frameset.document.styleSheetSets.contains(title)) {
DOMStringList

(In reply to Ian Neal from comment #17)
> (In reply to Archaeopteryx [:aryx] from comment #12)
> > Created attachment 8600284 [details] [diff] [review]
> > suite/common, v1
> 
> Isn't there some in:
> suite/common/downloads/downloadmanager.js
> line 680 -- if (types.contains("text/uri-list") ||
> line 681 -- types.contains("text/x-moz-url") ||
> line 682 -- types.contains("text/plain"))
DOMStringList

> suite/common/search/search.xml
DOMStringList and classLists

> suite/common/sidebar/sidebarOverlay.js
classLists
Flags: needinfo?(archaeopteryx)
Attachment #8600281 - Flags: review?(mkmelin+mozilla) → review+
Attachment #8600282 - Flags: review?(mkmelin+mozilla) → review+

Updated

4 years ago
Attachment #8600283 - Flags: review?(neil) → review+

Updated

4 years ago
Attachment #8600284 - Flags: review?(neil) → review+
Reporter

Updated

4 years ago
Duplicate of this bug: 1160631
suite/browser: https://hg.mozilla.org/comm-central/rev/5e4860468aba
suite/common: https://hg.mozilla.org/comm-central/rev/8f08e3298ab8
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 40.0
You need to log in before you can comment on or make changes to this bug.