Skip to content

Commit

Permalink
fix: babel 7.5, fixes #1292
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Jul 7, 2019
1 parent 4112e83 commit 4441d6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/babel.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ function plugin(args, options = {}) {
const expression = t.isExpression(path.node.declaration)
? path.node.declaration
: t.toExpression(path.node.declaration);
path.insertBefore(t.variableDeclaration('const', [t.variableDeclarator(id, expression)]));
path.scope.registerDeclaration(
path.insertBefore(t.variableDeclaration('const', [t.variableDeclarator(id, expression)]))[0],
);
path.node.declaration = id; // eslint-disable-line no-param-reassign

// It won't appear in scope.bindings
Expand Down

0 comments on commit 4441d6d

Please sign in to comment.