Skip to content

Commit 4441d6d

Browse files
committed
fix: babel 7.5, fixes #1292
1 parent 4112e83 commit 4441d6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/babel.dev.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ function plugin(args, options = {}) {
115115
const expression = t.isExpression(path.node.declaration)
116116
? path.node.declaration
117117
: t.toExpression(path.node.declaration);
118-
path.insertBefore(t.variableDeclaration('const', [t.variableDeclarator(id, expression)]));
118+
path.scope.registerDeclaration(
119+
path.insertBefore(t.variableDeclaration('const', [t.variableDeclarator(id, expression)]))[0],
120+
);
119121
path.node.declaration = id; // eslint-disable-line no-param-reassign
120122

121123
// It won't appear in scope.bindings

0 commit comments

Comments
 (0)