Replace in-tree consumer of non-standard Iterator() with Object.{values,entries} in services/

RESOLVED FIXED

Status

Cloud Services
General
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: arai, Assigned: Sumit Tiwari, Mentored)

Tracking

unspecified
Points:
---

Firefox Tracking Flags

(firefox51 fixed)

Details

(Whiteboard: [good first bug] [lang=js])

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
separated from bug 1290637.
see bug 1290637 for the details.

Required code changes are following:
  * Check each usage of non-standard Iterator [1] function,
    and replace it with Object.entries [2] or Object.values [3],
    or something appropriate for the specific usage

Here's the rough list for Iterator() usage (not exhaustive)
https://dxr.mozilla.org/mozilla-central/search?q=%22+Iterator(%22+path%3Aservices%2F&redirect=false

for example:
  for (let [k, v] in Iterator(obj)) {
    ...
  }
can be replaced to:
  for (let [k, v] of Object.entries(obj)) {
    ...
  }

another example:
  for (let [, v] in Iterator(array)) {
    ...
  }
can be replaced to:
  for (let v of array) {
    ...
  }


[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator
[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
[3] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values
Comment hidden (mozreview-request)
(Assignee)

Comment 2

2 years ago
All tests in the services/ folder passed, so hopefully this changeset won't have the same mistakes as the one for bug 1290698.
(Reporter)

Updated

2 years ago
Assignee: nobody → sumi29
Status: NEW → ASSIGNED
(Reporter)

Comment 3

2 years ago
mozreview-review
Comment on attachment 8779154 [details]
Bug 1292995 - Replace Iterator() with Object.{values,entries} in services/;

https://reviewboard.mozilla.org/r/70186/#review67512

Thank you for taking this :)

Looks good.
forwarding to gps, as I'm not module owner/peer here.
(Reporter)

Updated

2 years ago
Attachment #8779154 - Flags: review?(gps)
(Reporter)

Updated

2 years ago
Attachment #8779154 - Flags: review?(arai.unmht) → feedback+

Comment 4

2 years ago
mozreview-review
Comment on attachment 8779154 [details]
Bug 1292995 - Replace Iterator() with Object.{values,entries} in services/;

https://reviewboard.mozilla.org/r/70186/#review67700
Attachment #8779154 - Flags: review?(gps) → review+

Comment 6

2 years ago
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/7bab284d7910
Replace Iterator() with Object.{values,entries} in services/; r=gps

Comment 7

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/7bab284d7910
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox51: --- → fixed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.