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:
Sebastian McKenzie 2016-01-22 10:31:04 +00:00
commit 12ddcc7def
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;
});
}
})();
}
}