Closed Bug 1540457 Opened 7 years ago Closed 7 years ago

Remove Javascript Array generics in Thunderbird

Categories

(MailNews Core :: Backend, enhancement)

enhancement
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 68.0

People

(Reporter: aceman, Assigned: aceman)

References

Details

Attachments

(1 file, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #1322124 +++

From bug 1222547 comment 0:

Array generics are non-standard SpiderMonkey extension and they should be removed.

  • Array.concat
  • Array.every
  • Array.filter
  • Array.forEach
  • Array.indexOf
  • Array.join
  • Array.lastIndexOf
  • Array.map
  • Array.pop
  • Array.push
  • Array.reduce
  • Array.reduceRight
  • Array.reverse
  • Array.shift
  • Array.slice
  • Array.some
  • Array.sort
  • Array.splice
  • Array.unshift
Attached patch 1540457.patch (obsolete) — Splinter Review
Assignee: nobody → acelists
Status: NEW → ASSIGNED
Attachment #9054735 - Flags: review?(mkmelin+mozilla)
Severity: normal → minor
Comment on attachment 9054735 [details] [diff] [review] 1540457.patch Review of attachment 9054735 [details] [diff] [review]: ----------------------------------------------------------------- ::: common/src/customizeToolbar.js @@ +197,5 @@ > * Wraps all items in all customizable toolbars in a toolbox. > */ > function wrapToolbarItems() { > forEachCustomizableToolbar(function(toolbar) { > + Array.from(toolbar.childNodes).forEach(function(item) { I think for (let item of toolbar.childNodes) would be more elegant @@ +360,5 @@ > aItem.removeAttribute("observes"); > aItem.removeAttribute("type"); > aItem.removeAttribute("width"); > > + Array.from(aWrapper.querySelectorAll("[disabled]")).forEach(function(aNode) { querSelectorAll(....).forEach works ::: mail/base/content/msgMail3PaneWindow.js @@ +1956,5 @@ > }, > > _sizePlaceholder(type, width) { > + Array.from(document.querySelectorAll(".titlebar-placeholder[type='" + type + "']")).forEach( > + function(node) { node.style.width = width + "px"; }); just use querySelectorAll(.....).forEach ::: mail/base/modules/GlobalPopupNotifications.jsm @@ +1266,5 @@ > } > > let notifications = this._getNotificationsForBrowser(browser); > // Mark notifications as dismissed and call dismissal callbacks > + Array.from(this.panel.children).forEach(function(nEl) { for (let nEl of this.panel.children)
Attachment #9054735 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9054776 [details] [diff] [review] 1540457.patch v2 Review of attachment 9054776 [details] [diff] [review]: ----------------------------------------------------------------- LGTM thx! r=mkmelin
Attachment #9054776 - Flags: review?(mkmelin+mozilla) → review+
Attachment #9054735 - Attachment is obsolete: true

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/1ff36478a185
remove remaining Array generics in Thunderbird. r=mkmelin DONTBUILD

Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 68.0

What about:
JavaScript warning: chrome://global/content/bindings/tabbox.xml, line 258: Array.indexOf is deprecated; use Array.prototype.indexOf instead

Flags: needinfo?(acelists)

I would kill that if .indexOf() is in our code, but that looks like m-c? They still have to sweep their stuff.

Flags: needinfo?(acelists)

Sorry, "global", yes, M-C.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: