Jason Orendorff wrote:
On Fri, Jan 29, 2016 at 8:14 AM, ` Mystery . <[email protected]> wrote:
IMHO I don't think the default parameters should be evaluated within the
context of the function being called, at least not while it's outside of
function body's region...... Is there a specific reason to do that, or it's
just a design preference?

Sure, there is a reason: it's about how defaults are used.

Most defaults are probably constants or empty objects. Those don't
need to refer to any variables at all, so we can set them aside.

Well, primitive-valued constants are fine. But if you have an empty object constant, which is statically attached to the function instance instead of being re-evaluated at every call, that would surely cause enough havoc already :-)

Regards,
 Bergi
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to