Fix transform-arrow-functions in { spec: true } shadowing (#6760)
* Fix transform-arrow-functions in { spec: true } shadowing
The function name matching the variable declaration name could
shadow the actual function object inside the generated function,
leading to invalid behavior due to holding a reference to the
original unbound function.
* Combine it with transform-function-name just to be sure in spec: false
* Revert "Fix transform-arrow-functions in { spec: true } shadowing"
This reverts commit 1cafe2561d0b0ddd181b956a85eb074621da12e8.
* Much simpler version of the above fix
* Missing fixture updates
* Avoid using rest/spread to make the tests pass on node 4
* ...actually update _all_ the fixtures
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
var _this = this;
|
||||
|
||||
// These are actually handled by transform-arrow-functions
|
||||
const x = function x() {
|
||||
const _x = function x() {
|
||||
babelHelpers.newArrowCheck(this, _this);
|
||||
return x;
|
||||
return _x;
|
||||
}.bind(this);
|
||||
|
||||
const y = function y(x) {
|
||||
@@ -14,6 +14,6 @@ const y = function y(x) {
|
||||
const z = {
|
||||
z: function z() {
|
||||
babelHelpers.newArrowCheck(this, _this);
|
||||
return y(x);
|
||||
return y(_x);
|
||||
}.bind(this)
|
||||
}.z;
|
||||
|
||||
Reference in New Issue
Block a user