Files
1a4011f67e fix: improve variable declarator removal (#16587)
* fix: fixed issue16583 + test

* modified getBinding to getOwnBinding (same scope)

* reverted babel-plugin-proposal-do-expressions back

* refactor: moved fix from scope/index.ts to path/removal.ts

* add fail test

* fix

* review

* Update packages/babel-traverse/test/fixtures/scope/remove-nested-let-path/plugin.js

Co-authored-by: Nicolò Ribaudo <[email protected]>

* review

* Update packages/babel-traverse/src/path/lib/removal-hooks.ts

---------

Co-authored-by: Babel Bot <[email protected]>
Co-authored-by: Nicolò Ribaudo <[email protected]>
2024-07-27 08:57:14 -04:00

11 lines
197 B
JavaScript

module.exports = function () {
return {
visitor: {
VariableDeclarator(path) {
path.remove();
expect(path.scope.getBinding("a")).toBeUndefined();
},
},
};
};