Closed
Bug 1215965
Opened 9 years ago
Closed 9 years ago
Remove use of non-standard features from toolkit/components/social/SocialService.jsm.
Categories
(Firefox Graveyard :: SocialAPI, defect)
Firefox Graveyard
SocialAPI
Tracking
(firefox44 fixed)
RESOLVED
FIXED
Firefox 44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file)
(deleted),
patch
|
mixedpuppy
:
review+
|
Details | Diff | Splinter Review |
https://dxr.mozilla.org/mozilla-central/source/toolkit/components/social/SocialService.jsm
Most use of non-standard SpiderMonkey extensions (legacy generator, for each, legacy array comprehension, etc) related to |SocialServiceInternal.manifests| have to be removed at once for simplicity.
I'll post a patch shortly.
Assignee | ||
Comment 1•9 years ago
|
||
> - return [p for ([, p] of Iterator(this.providers))];
> + return Object.keys(this.providers).map(origin => this.providers[origin]);
We could use Object.values once it's implemented (bug 1208464), but not now.
for now, changed it to Object.keys + map.
> - get manifests() {
> + *manifestsGenerator() {
...
> + get manifests() {
> + return this.manifestsGenerator();
> + },
This is a getter with legacy generator, that cannot be expressed in standard way.
I separated it into getter and ES6 generator method (SocialServiceInternal.manifestsGenerator), and now |manifests| getter calls manifestsGenerator and returns Generator object.
> - [ '"' + host + '"' for each (host in hosts) ].join(",") + ") "
> + hosts.map(host => '"' + host + '"').join(",") + ") "
|[f(x) for each (x in array)]| can be rewritten as
|array.map(x => f(x))|
> - let providerHasFeatures = [url for (url of featureURLs) if (data[url])].length > 0;
> + let providerHasFeatures = featureURLs.some(url => data[url]);
|[x for each (x in array) if (g(x)]| can be rewritten as
|array.filter(x => g(x))|
also, |array.filter(x => g(x)).length > 0| can be rewritten as
|array.some(x => g(x))| if g(x) has no side effect
> - aCallback([new AddonWrapper(a) for each (a in SocialServiceInternal.manifests)]);
> + aCallback([...SocialServiceInternal.manifests].map(a => new AddonWrapper(a)));
|[f(x) for each (x in iterable)]| can be rewritten as
|[...iterable].map(x => f(x))|
Green on try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=be9bccacc8c1&group_state=expanded
Assignee: nobody → arai.unmht
Attachment #8675525 -
Flags: review?(jaws)
Updated•9 years ago
|
Attachment #8675525 -
Flags: review?(jaws) → review?(mixedpuppy)
Comment 2•9 years ago
|
||
Comment on attachment 8675525 [details] [diff] [review]
Remove use of non-standard features from toolkit/components/social/SocialService.jsm.
looks ok. I've never cared for spread syntax, every time I see it I have a WTF moment.
Attachment #8675525 -
Flags: review?(mixedpuppy) → review+
Assignee | ||
Comment 3•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/c41fe3decc83c6c02aff6ed4e0a502e142c31fed
Bug 1215965 - Remove use of non-standard features from toolkit/components/social/SocialService.jsm. r=mixedpuppy
Comment 4•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
Updated•6 years ago
|
Product: Firefox → Firefox Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•