2012/10/10 Keith Cirkel <[email protected]>

> You /are/ actually passing in a second argument though, your second
> argument is `undefined`. Default arguments aren't meant to replace
> `undefined` values, they're meant to be permissible for omission.


>From https://bugzilla.mozilla.org/show_bug.cgi?id=781422#c1
    function f(x=EXPR) { BODY }
will expand to:
    function f(x) {
        if (x === undefined)
            x = EXPR;
        BODY
    }

It seems that default arguments are meant to replace 'undefined' for last
arguments and that's my experience playing with the latest nightly where
the bug has been fixed.

What's the intention of the spec?
Is current Firefox Nightly compliant?
Can test262 tests be added to express what is expected from implementors?
Debating tests would enable keeping track of the discussions that occurred
and record the decision in an (arguably) more formal way than the spec.

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

Reply via email to