fix predence of destructuring parameters - fixes #2269

This commit is contained in:
Sebastian McKenzie
2015-08-27 11:10:22 -07:00
parent 310de83b63
commit b8d53c1811
2 changed files with 9 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
const f0 = (a, b = a, c = b) => [a, b, c];
assert.deepEqual(f0(1), [1, 1, 1]);
const f1 = ({a}, b = a, c = b) => [a, b, c];
assert.deepEqual(f1({a: 1}), [1, 1, 1]);
const f2 = ({a}, b = a, c = a) => [a, b, c];
assert.deepEqual(f2({a: 1}), [1, 1, 1]);