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> {
100
100
} ,
101
101
102
102
exit ( ) {
103
- this . macroBuilder . expand ( ) ;
103
+ this . macroBuilder . cleanImports ( ) ;
104
104
} ,
105
105
} ,
106
106
Original file line number Diff line number Diff line change @@ -26,14 +26,6 @@ export default class Macros {
26
26
} ) ;
27
27
}
28
28
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
-
37
29
/**
38
30
* Collects the import bindings for the debug tools.
39
31
*/
@@ -53,7 +45,7 @@ export default class Macros {
53
45
}
54
46
55
47
/**
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 .
57
49
*/
58
50
build ( path : NodePath < t . ExpressionStatement > ) {
59
51
if ( ! isCallStatementPath ( path ) ) {
@@ -68,7 +60,10 @@ export default class Macros {
68
60
}
69
61
}
70
62
71
- _cleanImports ( ) {
63
+ /**
64
+ * Removes obsolete import bindings for the debug tools.
65
+ */
66
+ cleanImports ( ) {
72
67
if ( ! this . debugHelpers ?. module ) {
73
68
if ( this . localDebugBindings . length > 0 ) {
74
69
let importPath = this . localDebugBindings [ 0 ] . findParent ( ( p ) =>
You can’t perform that action at this time.
0 commit comments