Invalidate the scope cache if a node is moved to a different path - fixes T7194
This commit is contained in:
13
packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/T7194/actual.js
vendored
Normal file
13
packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/T7194/actual.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
function f() {
|
||||
g(async function() {
|
||||
c(() => this);
|
||||
});
|
||||
}
|
||||
|
||||
(async function () {
|
||||
console.log('async wrapper:', this === 'foo')
|
||||
|
||||
;(() => {
|
||||
console.log('nested arrow:', this === 'foo')
|
||||
})()
|
||||
}).call('foo')
|
||||
17
packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/T7194/expected.js
vendored
Normal file
17
packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/T7194/expected.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
function f() {
|
||||
g(babelHelpers.asyncToGenerator(function* () {
|
||||
var _this = this;
|
||||
|
||||
c(function () {
|
||||
return _this;
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
babelHelpers.asyncToGenerator(function* () {
|
||||
var _this2 = this;
|
||||
|
||||
console.log('async wrapper:', this === 'foo');(function () {
|
||||
console.log('nested arrow:', _this2 === 'foo');
|
||||
})();
|
||||
}).call('foo');
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"plugins": [
|
||||
"transform-es2015-arrow-functions",
|
||||
"transform-async-to-generator",
|
||||
"external-helpers"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user