Fix scope of function body when var redeclares param (#11158)

* Fix scope of function body when var redeclares param

* Fix empty var declarations

* Apply suggestions
This commit is contained in:
Daryl Tan
2020-03-01 23:26:22 +08:00
committed by GitHub
parent a39beda58b
commit 9015fda3c1
17 changed files with 140 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
function foo({a, b}) {
var a = 3;
var c = 2;
var d = a + b + c;
}

View File

@@ -0,0 +1,9 @@
function foo(_ref) {
var a = _ref.a,
b = _ref.b;
return function () {
var a = 3;
var c = 2;
var d = a + b + c;
}();
}