@babel/helper-hoist-variables
Advanced tools
Comparing version 7.14.5 to 7.15.4
@@ -8,4 +8,9 @@ "use strict"; | ||
var t = require("@babel/types"); | ||
var _t = require("@babel/types"); | ||
const { | ||
assignmentExpression, | ||
expressionStatement, | ||
identifier | ||
} = _t; | ||
const visitor = { | ||
@@ -30,7 +35,7 @@ Scope(path, state) { | ||
if (declar.node.init) { | ||
nodes.push(t.expressionStatement(t.assignmentExpression("=", declar.node.id, declar.node.init))); | ||
nodes.push(expressionStatement(assignmentExpression("=", declar.node.id, declar.node.init))); | ||
} | ||
for (const name of Object.keys(declar.getBindingIdentifiers())) { | ||
state.emit(t.identifier(name), name, declar.node.init !== null); | ||
state.emit(identifier(name), name, declar.node.init !== null); | ||
} | ||
@@ -37,0 +42,0 @@ } |
{ | ||
"name": "@babel/helper-hoist-variables", | ||
"version": "7.14.5", | ||
"version": "7.15.4", | ||
"description": "Helper function to hoist variables", | ||
@@ -17,7 +17,7 @@ "repository": { | ||
"dependencies": { | ||
"@babel/types": "^7.14.5" | ||
"@babel/types": "^7.15.4" | ||
}, | ||
"TODO": "The @babel/traverse dependency is only needed for the NodePath TS type. We can consider exporting it from @babel/core.", | ||
"devDependencies": { | ||
"@babel/traverse": "7.14.5" | ||
"@babel/traverse": "7.15.4" | ||
}, | ||
@@ -24,0 +24,0 @@ "engines": { |
3448
46
Updated@babel/types@^7.15.4