Jeff Morrison (2013-09-30T20:17:14.000Z)
domenic at domenicdenicola.com (2013-10-13T02:49:57.863Z)
So I think during the last meeting it was decided that we'd now have two scopes for functions with default param values: One for head/params, and one for the function body. Was it also agreed that we'd use let-binding (vs var-binding) for the default-value expressions? I also just wanted to clarify some of the awkward edge-case scenarios as I understand them to be sure we're all on the same page: ```js var x=1, y=2; function foo(x=3, y=y, z=y) { return [x, y, z]; } foo(); // [3, undefined, undefined] ? or [3, 2, 2] ? foo(2); // [2, undefined, undefined]; foo(2, 3); // [2, u]; x; // 1 y; // 2 var x = 1, y=2; function foo(x=3,y=x+1) { return [x, y]; } foo(); // [3, 4]; foo(2); // [2, 4]; foo(2, 3); // [2, 3]; x; // 1 y; // 2 var x = 1, y=2; function foo(x=3, y=(x=undefined,4)) { return [x,y]; } foo(); // [undefined, 4] foo(2); // [undefined, 4] foo(2, 3); // [2, 3] ? or [undefined, 3] ? x; // 1 y; // 2 function foo(bar=(function() { return 'param-inner'; })) { var ret = bar(); function bar() { return 'body-inner'; } return ret; } foo(); // 'body-inner' foo(function() { return 'futility'; }); // 'body-inner' ```