Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inject IIFE when variables shadow binding in rest param
- Loading branch information
1 parent
373f733
commit 7b2108c
Showing
8 changed files
with
106 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
...orm-parameters/test/fixtures/parameters/.var-same-name-as-nested-in-rest-param-2/input.js
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...sform-parameters/test/fixtures/parameters/.var-same-name-as-nested-in-rest-param/input.js
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...form-parameters/test/fixtures/parameters/var-same-name-as-nested-in-rest-param-2/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function f(...{ length: x = 0, y = x }) { | ||
var x; | ||
return x; | ||
} | ||
|
||
function g(...{ length: x = 0, y = x }) { | ||
var x = 1; | ||
return x; | ||
} |
26 changes: 26 additions & 0 deletions
26
...orm-parameters/test/fixtures/parameters/var-same-name-as-nested-in-rest-param-2/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
function f() { | ||
for (var _len = arguments.length, _ref = new Array(_len), _key = 0; _key < _len; _key++) { | ||
_ref[_key] = arguments[_key]; | ||
} | ||
|
||
var _ref$length = _ref.length, | ||
x = _ref$length === void 0 ? 0 : _ref$length, | ||
_ref$y = _ref.y, | ||
y = _ref$y === void 0 ? x : _ref$y; | ||
return x; | ||
} | ||
|
||
function g() { | ||
for (var _len2 = arguments.length, _ref2 = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
_ref2[_key2] = arguments[_key2]; | ||
} | ||
|
||
var _ref2$length = _ref2.length, | ||
x = _ref2$length === void 0 ? 0 : _ref2$length, | ||
_ref2$y = _ref2.y, | ||
y = _ref2$y === void 0 ? x : _ref2$y; | ||
return function (x) { | ||
var x = 1; | ||
return x; | ||
}(x); | ||
} |
9 changes: 9 additions & 0 deletions
9
...nsform-parameters/test/fixtures/parameters/var-same-name-as-nested-in-rest-param/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function f(...[x, y = x]) { | ||
var x; | ||
return x; | ||
} | ||
|
||
function g(...[x, y = x]) { | ||
var x = 1; | ||
return x; | ||
} |
24 changes: 24 additions & 0 deletions
24
...sform-parameters/test/fixtures/parameters/var-same-name-as-nested-in-rest-param/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
function f() { | ||
for (var _len = arguments.length, _ref = new Array(_len), _key = 0; _key < _len; _key++) { | ||
_ref[_key] = arguments[_key]; | ||
} | ||
|
||
var x = _ref[0], | ||
_ref$ = _ref[1], | ||
y = _ref$ === void 0 ? x : _ref$; | ||
return x; | ||
} | ||
|
||
function g() { | ||
for (var _len2 = arguments.length, _ref2 = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
_ref2[_key2] = arguments[_key2]; | ||
} | ||
|
||
var x = _ref2[0], | ||
_ref2$ = _ref2[1], | ||
y = _ref2$ === void 0 ? x : _ref2$; | ||
return function (x) { | ||
var x = 1; | ||
return x; | ||
}(x); | ||
} |