Closed
Bug 1217983
Opened 9 years ago
Closed 9 years ago
Remove use of for-each from b2g/.
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(firefox44 fixed)
RESOLVED
FIXED
FxOS-S10 (30Oct)
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file)
1.15 KB,
patch
|
fabrice
:
review+
|
Details | Diff | Splinter Review |
Need to replace non-standard for-each with one of: * for-of * for-in * array.map/array.filter for array-comprehension as a part of bug 1083470. converting rules are following: * for-each * for each (let x in array) { ... } -> for (let x of array) { ... } * for each (let x in object) { ... } -> for (let key in object) { let x = object[key]; ... } * for each (let [key, value] in Iterator(object)) { ... } -> for (let key in object) { let value = object[key]; ... } * for each (let x in array) { ... } where array can be null or undefined -> if (array) { for (let x of array) { ... } } * legacy array comprehension with for-each (newer array comprehension is now also a non-standard feature, I'd like to go with map/filter) * [EXPR for each (x in array)] -> array.map(x => EXPR) * [EXPR for each (x in array) if (COND)] -> array.filter(x => COND).map(x => EXPR) * [x for each (x in array) if (COND)] -> array.filter(x => COND) * [EXPR for each ([i, x] in Iterator(array)) if (g(x, i)] -> array.filter((x, i) => g(x, i)).map((x => EXPR) * [EXPR for each (x in arraylike)] -> Array.from(arraylike).map(x => EXPR) * [EXPR for each (x in string)] -> Array.prototype.slice.call(string).map(x => EXPR) // Array.from behaves differently for surrogate-pair
Assignee | ||
Comment 1•9 years ago
|
||
Almost green on try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=77c5563839da
Attachment #8678319 -
Flags: review?(fabrice)
Comment 2•9 years ago
|
||
Comment on attachment 8678319 [details] [diff] [review] Remove for-each from b2g/. Review of attachment 8678319 [details] [diff] [review]: ----------------------------------------------------------------- Thanks!
Attachment #8678319 -
Flags: review?(fabrice) → review+
Assignee | ||
Comment 3•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/6e1c8c268f842b440ff04295ba2bb994f04b4be7 Bug 1217983 - Remove for-each from b2g/. r=fabrice
Comment 4•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6e1c8c268f84
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S10 (30Oct)
You need to log in
before you can comment on or make changes to this bug.
Description
•