fix predence of destructuring parameters - fixes #2269
This commit is contained in:
@@ -95,7 +95,7 @@ export var visitor = {
|
||||
t.inherits(ref, pattern);
|
||||
|
||||
var destructuring = new DestructuringTransformer({
|
||||
blockHoist: node.params.length - i,
|
||||
blockHoist: node.params.length - i + 1,
|
||||
nodes: nodes,
|
||||
scope: scope,
|
||||
file: 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]);
|
||||
Reference in New Issue
Block a user