@@ -642,7 +642,7 @@ function(${args}) {
642642 }
643643 } ) ;
644644
645- let isFunction = false ;
645+ const isFunction = typeof snippet == 'function' ;
646646 let isNativeAlias = false ;
647647
648648 const postsetId = symbol + '__postset' ;
@@ -680,8 +680,7 @@ function(${args}) {
680680 } else if ( typeof snippet == 'object' ) {
681681 snippet = stringifyWithFunctions ( snippet ) ;
682682 addImplicitDeps ( snippet , deps ) ;
683- } else if ( typeof snippet == 'function' ) {
684- isFunction = true ;
683+ } else if ( isFunction ) {
685684 snippet = processLibraryFunction ( snippet , symbol , mangled , deps , isStub ) ;
686685 addImplicitDeps ( snippet , deps ) ;
687686 if ( CHECK_DEPS && ! isUserSymbol ) {
@@ -727,6 +726,7 @@ function(${args}) {
727726 // Handle arrow functions
728727 contentText = `var ${ mangled } = ` + contentText + ';' ;
729728 } else if ( contentText . startsWith ( 'class ' ) ) {
729+ // Handle class declarations (which also have typeof == 'function'.)
730730 contentText = contentText . replace ( / ^ c l a s s / , `class ${ mangled } ` ) ;
731731 } else {
732732 // Handle regular (non-arrow) functions
0 commit comments