1+ const { parse } = require ( '@babel/parser' )
12const generator = require ( '@babel/generator' ) . default
23const t = require ( '@babel/types' )
34
@@ -184,7 +185,7 @@ function checkStackInvalid(path, invalid) {
184185
185186function checkChangeValid ( invalid , used ) {
186187 let valid = true
187- Object . keys ( used ) . forEach ( function ( key ) {
188+ Object . keys ( used ) . forEach ( function ( key ) {
188189 if ( Object . prototype . hasOwnProperty . call ( invalid , key ) ) {
189190 valid = false
190191 }
@@ -291,7 +292,7 @@ function processStackParam(path, len) {
291292 while ( changed ) {
292293 checkStackInvalid ( path , invalid )
293294 if ( ! checkChangeValid ( invalid , used ) ) {
294- path . replaceWith ( prase ( orig_code ) )
295+ path . replaceWith ( parse ( orig_code ) )
295296 used = { }
296297 }
297298 changed = tryStackReplace ( path , len , invalid , used )
@@ -309,7 +310,9 @@ const deStackFuncLen = {
309310 let binding = obj . path . parentPath . scope . bindings [ obj . name ]
310311 for ( const ref of binding . referencePaths ) {
311312 if ( ref . key !== 'callee' ) {
312- console . warn ( `[Stack] Unexpected ref of functionLengthName: ${ obj . name } ` )
313+ console . warn (
314+ `[Stack] Unexpected ref of functionLengthName: ${ obj . name } `
315+ )
313316 continue
314317 }
315318 const repl_path = ref . parentPath
0 commit comments