change behavior of Array.prototype.push?

Jann Horn jann at thejh.net
Sat Oct 29 23:07:20 UTC 2016


On Sat, Oct 29, 2016 at 03:15:48PM -0700, Jordan Harband wrote:
> That just means anyone relying on that behavior is broken in Firefox - if
> their code would work in all of the other browsers, then it's a Firefox
> bug, not something the spec can change.

But apparently, nobody's stuff broke.
In the Linux kernel, the approach to API changes is basically "you can
change things as long as no existing userspace code breaks because of
those changes", which I think is reasonable.
And as far as I can tell, ECMAScript uses a similar approach; for
example, AFAIK in ECMAScript 6.0, the following code would have worked,
but ECMAScript 7.0 breaks it (by making %ObjectPrototype% an immutable
prototype exotic object):

    Reflect.setPrototypeOf(Object.prototype, {__proto__:null, a:1});
    console.log(({}).a);

So clearly, reasonable breakage in new ECMAScript versions is permitted.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20161030/ecb6fcba/attachment.sig>


More information about the es-discuss mailing list