take into consideration non-identifier nodes in es6.blockScopingTDZ transformer, also turn default and parameters into lets instead of vars - fixes #929
This commit is contained in:
9
test/fixtures/transformation/es6-block-scoping-tdz-fail/destructuring.js
vendored
Normal file
9
test/fixtures/transformation/es6-block-scoping-tdz-fail/destructuring.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
function foo(
|
||||
{ x: { y: { z: a = b } = {}, w: b = 20 }, a: c = 30 }
|
||||
) {
|
||||
assert.equal(a, 10);
|
||||
assert.equal(b, 20);
|
||||
assert.equal(c, 30);
|
||||
}
|
||||
|
||||
foo({ x: {} });
|
||||
9
test/fixtures/transformation/es6-block-scoping-tdz-pass/destructuring.js
vendored
Normal file
9
test/fixtures/transformation/es6-block-scoping-tdz-pass/destructuring.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
function foo(
|
||||
{ x: { y: { z: a = 10 } = {}, w: b = 20 }, a: c = 30 }
|
||||
) {
|
||||
assert.equal(a, 10);
|
||||
assert.equal(b, 20);
|
||||
assert.equal(c, 30);
|
||||
}
|
||||
|
||||
foo({ x: {} });
|
||||
Reference in New Issue
Block a user