[hotfix][T2765#72428] Wrong 'this' for nested arrow in arrow function

This commit is contained in:
horpto
2016-01-22 10:29:04 +05:00
parent b326a3fd1e
commit d0a932d0e8
3 changed files with 42 additions and 4 deletions

View File

@@ -24,10 +24,6 @@ let arrowBuildWrapper = template(`
`);
let awaitVisitor = {
Function(path) {
path.skip();
},
ArrowFunctionExpression(path) {
if (!path.node.async) {
path.arrowFunctionToShadowed();

View File

@@ -2,5 +2,19 @@ class Class {
async method() {
this;
() => this;
() => {
this;
() => this;
function x() {
this;
() => {this}
async () => {this}
}
}
function x() {
this;
() => {this}
async () => {this}
}
}
}

View File

@@ -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;
});
}
})();
}
}