File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ export default function macros(babel: typeof Babel): Babel.PluginObj<State> {
100100 } ,
101101
102102 exit ( ) {
103- this . macroBuilder . expand ( ) ;
103+ this . macroBuilder . cleanImports ( ) ;
104104 } ,
105105 } ,
106106
Original file line number Diff line number Diff line change @@ -26,14 +26,6 @@ export default class Macros {
2626 } ) ;
2727 }
2828
29- /**
30- * Injects the either the env-flags module with the debug binding or
31- * adds the debug binding if missing from the env-flags module.
32- */
33- expand ( ) {
34- this . _cleanImports ( ) ;
35- }
36-
3729 /**
3830 * Collects the import bindings for the debug tools.
3931 */
@@ -53,7 +45,7 @@ export default class Macros {
5345 }
5446
5547 /**
56- * Builds the expressions that the CallExpression will expand into .
48+ * Expands the given expression, if it is simple CallExpression statement for the debug tools .
5749 */
5850 build ( path : NodePath < t . ExpressionStatement > ) {
5951 if ( ! isCallStatementPath ( path ) ) {
@@ -68,7 +60,10 @@ export default class Macros {
6860 }
6961 }
7062
71- _cleanImports ( ) {
63+ /**
64+ * Removes obsolete import bindings for the debug tools.
65+ */
66+ cleanImports ( ) {
7267 if ( ! this . debugHelpers ?. module ) {
7368 if ( this . localDebugBindings . length > 0 ) {
7469 let importPath = this . localDebugBindings [ 0 ] . findParent ( ( p ) =>
You can’t perform that action at this time.
0 commit comments