Files
Nicolò RibaudoandGitHub a143706e14 Run Babel asynchronously in fixtures (#14659)
* Run Babel asynchronously in fixtures

* Move `checkScopeInfo` to test folder, convert to ESM

* Fix Node.js 8

* Avoid dynamic import feature detection
2022-06-15 04:51:01 +02:00

23 lines
610 B
JavaScript

export default () => {
return {
visitor: {
Program: {
exit(programPath) {
// so that this plugin is always called after the transform-destructuring plugin
programPath.traverse({
VariableDeclarator(path) {
const names = Object.keys(path.getBindingIdentifiers());
for (const name of names) {
const b = path.scope.getBinding(name);
if (!b) {
throw new Error(`No binding for ${name}`);
}
}
},
});
},
},
},
};
};