Hi all,
Yesterday I landed a patch to change how `arguments` works inside arrow
functions [0]. `arguments` is now lexically bound (inherited from the outer
function), similar to `this`. For example, the following function will now
return 1 instead of 2:
(function() {
var f = () => arguments[0];
return f(2);
})(1);
Arrow functions no longer have their own arguments object, but rest
parameters are a good alternative in most cases: (...args) => args[i]
Our codebase (chrome, tests, Gaia) relied on the old behavior in a number
of places [1][2], so I think people should be aware of this subtle change.
Thanks,
Jan
[0] https://bugzilla.mozilla.org/show_bug.cgi?id=889158
[1] https://hg.mozilla.org/mozilla-central/rev/a7b04b9e4f17
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1196202,
https://bugzilla.mozilla.org/show_bug.cgi?id=1197787
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform