@@ -642,7 +642,7 @@ function(${args}) {
642
642
}
643
643
} ) ;
644
644
645
- let isFunction = false ;
645
+ const isFunction = typeof snippet == 'function' ;
646
646
let isNativeAlias = false ;
647
647
648
648
const postsetId = symbol + '__postset' ;
@@ -680,8 +680,7 @@ function(${args}) {
680
680
} else if ( typeof snippet == 'object' ) {
681
681
snippet = stringifyWithFunctions ( snippet ) ;
682
682
addImplicitDeps ( snippet , deps ) ;
683
- } else if ( typeof snippet == 'function' ) {
684
- isFunction = true ;
683
+ } else if ( isFunction ) {
685
684
snippet = processLibraryFunction ( snippet , symbol , mangled , deps , isStub ) ;
686
685
addImplicitDeps ( snippet , deps ) ;
687
686
if ( CHECK_DEPS && ! isUserSymbol ) {
@@ -727,6 +726,7 @@ function(${args}) {
727
726
// Handle arrow functions
728
727
contentText = `var ${ mangled } = ` + contentText + ';' ;
729
728
} else if ( contentText . startsWith ( 'class ' ) ) {
729
+ // Handle class declarations (which also have typeof == 'function'.)
730
730
contentText = contentText . replace ( / ^ c l a s s / , `class ${ mangled } ` ) ;
731
731
} else {
732
732
// Handle regular (non-arrow) functions
0 commit comments