Create File class for babel helpers (#10575)

* add test

* fix: pass File to helper traverser

* pass babel.File to helpers.ensure
This commit is contained in:
Huáng Jùnliàng
2020-03-17 04:58:46 -04:00
committed by GitHub
parent 748897be07
commit 4bf36e64da
8 changed files with 61 additions and 10 deletions

View File

@@ -134,6 +134,7 @@ function buildHelper(
if (!esm) {
bindings = [];
helpers.ensure(helperName, babel.File);
for (const dep of helpers.getDependencies(helperName)) {
const id = (dependencies[dep] = t.identifier(t.toIdentifier(dep)));
tree.body.push(template.statement.ast`