Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move environment-visitor helper into @babel/traverse #16577

Merged
merged 3 commits into from
Jul 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Avoid error due to version mismatch
  • Loading branch information
nicolo-ribaudo committed Jul 15, 2024
commit 2c5311c8899c7b84433addbc7da4d308e6665e50
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ export default declare(({ types: t, assertVersion }) => {
if (state.yield) path.stop();
},
});
if (!process.env.BABEL_8_BREAKING && !t.staticBlock) {
// StaticBlock was only introduced in Babel 7.12.0.
// If this plugin is being called by an old version
// of Babel, but `environmentVisitor` is being imported
// by a new one, we would get an error about an
// unknown visitor.
delete containsYieldOrAwaitVisitor.StaticBlock;
}

function containsClassExpression(path: NodePath<t.Node>) {
if (t.isClassExpression(path.node)) return true;
Expand Down