Closed Bug 1443630 Opened 6 years ago Closed 6 years ago

Implementing array.prototype.flatten broke MooTools' version of it.

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox-esr52 --- unaffected
firefox58 --- unaffected
firefox59 --- unaffected
firefox60 --- disabled

People

(Reporter: wisniewskit, Unassigned)

References

Details

(Keywords: regression, site-compat, Whiteboard: [webcompat])

MooTools seems to polyfill Array.prototype.flatten in a way which broke when we implemented proper support for it in bug 1421398.

So far this has manifested as a 14-day weather widget not appearing on wetteronline.de in https://webcompat.com/issues/15121, and it seems to be a problem with MooTools all the way to its most current release.

I'm still diagnosing exactly why it's breaking, but given that the 59 release is so close, I thought it best to file this bug right away so we can make a call on whether this is risky enough to warrant delaying the release of "flatten" for a cycle.
Flags: webcompat?
Flags: needinfo?(evilpies)
Requesting tracking because this causes site-bustage, dunno how many more sites in the wild are affected (but given mootools... probably more than a single weather site in Germany).
Flags: webcompat? → webcompat+
Keywords: regression
Keywords: site-compat
(In reply to Thomas Wisniewski from comment #0)
> I'm still diagnosing exactly why it's breaking, but given that the 59
> release is so close, I thought it best to file this bug right away so we can
> make a call on whether this is risky enough to warrant delaying the release
> of "flatten" for a cycle.

It looks like this feature is guarded to be Nightly-only right now, per this code:
> #ifdef NIGHTLY_BUILD
>     JS_SELF_HOSTED_FN("flatMap",     "ArrayFlatMap",     1,0),
>     JS_SELF_HOSTED_FN("flatten",     "ArrayFlatten",     0,0),
> #endif
https://dxr.mozilla.org/mozilla-central/rev/709eae4e54ffa3f3518745516dd5d27a05255af2/js/src/jsarray.cpp#3542-3545

...and per the existence of Bug 1435813 ("Enable Array.prototype.flatten and Array.prototype.flatMap in release builds")

So (unless testing contradicts that theory), I'd expect we don't need to worry about landing anything in a hurry for upcoming releases/merges.
(tentatively assuming that we should sort this out one way or another before shipping this feature -- hence, marking as blocking bug 1435813.)
Blocks: 1435813
>It looks like this feature is guarded to be Nightly-only right now, per this code


Good to hear. Unfortunately this looks like it's just MooTools breaking as it has before with other ECMAScript Array prototype extensions (likely similar to bug 1075059).
Opened up an issue with Mootools: https://github.com/mootools/mootools-core/issues/2797
(In reply to Thomas Wisniewski from comment #4)
> Good to hear. Unfortunately this looks like it's just MooTools breaking as
> it has before with other ECMAScript Array prototype extensions (likely
> similar to bug 1075059).

Is there any way to prevent this from happening in the future? Every time a new method is proposed, MooTools will take over the method with a premature implementation and we will forced to rename the method?
Yes, this is Nightly only, so we don't need to take any action immediately. See https://github.com/tc39/proposal-flatMap/pull/56#issue-173327251 for the tc39 discussion around this. We will follow whatever they come up with.
Flags: needinfo?(evilpies)
Priority: -- → P3
This is not going to be a concern with the new name 'flat'. (bug 1465039)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
Depends on: 1465039
You need to log in before you can comment on or make changes to this bug.