Skip to content

Commit 6528a62

Browse files
committed
note that the builder needs changings
1 parent 8804cbb commit 6528a62

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/macros.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ module.exports = class Macros {
4747

4848
if (
4949
this.builder.t.isCallExpression(expression) &&
50-
this.localDebugBindings.some(b => b.get('imported').node.name === expression.callee.name)
50+
this.localDebugBindings.some(b => b.get('local').node.name === expression.callee.name)
5151
) {
5252
let imported = path.scope.getBinding(expression.callee.name).path.node.imported.name;
53+
// The builder needs to be made aware of the the local name of the ImportSpecifier
5354
this.builder[`${imported}`](path);
5455
}
5556
}
@@ -62,12 +63,11 @@ module.exports = class Macros {
6263
// import declaration in question seems to have already been removed
6364
return;
6465
}
66+
6567
let specifiers = importPath.get('specifiers');
6668

6769
if (specifiers.length === this.localDebugBindings.length) {
6870
importPath.remove();
69-
} else if (specifiers.length === 1) {
70-
importPath.remove();
7171
} else {
7272
this.localDebugBindings.forEach(binding => binding.get('local').parentPath.remove());
7373
}

0 commit comments

Comments
 (0)