fix(transform-destructuring): update scope info after replacing

This commit is contained in:
Gerald 2020-03-05 22:29:31 +08:00 committed by Nicolò Ribaudo
parent 1011e58c6c
commit 8cafd8f820
4 changed files with 24 additions and 0 deletions

View File

@ -599,6 +599,7 @@ export default declare((api, options) => {
}
path.replaceWithMultiple(nodes);
path.scope.crawl();
},
VariableDeclaration(path) {

View File

@ -0,0 +1,5 @@
export default class A {
handle = value => {
({ value } = {});
}
}

View File

@ -0,0 +1,7 @@
{
"plugins": [
"proposal-class-properties",
"transform-parameters",
"transform-destructuring"
]
}

View File

@ -0,0 +1,11 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
export default class A {
constructor() {
_defineProperty(this, "handle", value => {
var _ref = {};
value = _ref.value;
});
}
}