Merge pull request #3297 from horpto/hotfix/T2765_72428
[hotfix][T2765#72428] Wrong 'this' for nested arrow in arrow function
This commit is contained in:
commit
12ddcc7def
@ -24,10 +24,6 @@ let arrowBuildWrapper = template(`
|
||||
`);
|
||||
|
||||
let awaitVisitor = {
|
||||
Function(path) {
|
||||
path.skip();
|
||||
},
|
||||
|
||||
ArrowFunctionExpression(path) {
|
||||
if (!path.node.async) {
|
||||
path.arrowFunctionToShadowed();
|
||||
|
||||
@ -2,5 +2,19 @@ class Class {
|
||||
async method() {
|
||||
this;
|
||||
() => this;
|
||||
() => {
|
||||
this;
|
||||
() => this;
|
||||
function x() {
|
||||
this;
|
||||
() => {this}
|
||||
async () => {this}
|
||||
}
|
||||
}
|
||||
function x() {
|
||||
this;
|
||||
() => {this}
|
||||
async () => {this}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,34 @@ class Class {
|
||||
(function () {
|
||||
return _this;
|
||||
});
|
||||
(function () {
|
||||
_this;
|
||||
(function () {
|
||||
return _this;
|
||||
});
|
||||
function x() {
|
||||
var _this2 = this;
|
||||
|
||||
this;
|
||||
(function () {
|
||||
_this2;
|
||||
});
|
||||
babelHelpers.asyncToGenerator(function* () {
|
||||
_this2;
|
||||
});
|
||||
}
|
||||
});
|
||||
function x() {
|
||||
var _this3 = this;
|
||||
|
||||
this;
|
||||
(function () {
|
||||
_this3;
|
||||
});
|
||||
babelHelpers.asyncToGenerator(function* () {
|
||||
_this3;
|
||||
});
|
||||
}
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user