@@ -545,7 +545,7 @@ class JSModuleAnalyzer {
545545 const args = node . arguments ;
546546 if ( args . length > 0 ) {
547547 const value = getStringValue ( args [ 0 ] ) ;
548- if ( value ) {
548+ if ( value !== undefined ) {
549549 const name = ModuleName . fromUI5LegacyName ( value ) ;
550550 if ( nModuleDeclarations === 1 && ! mainModuleFound ) {
551551 // if this is the first declaration, then this is the main module declaration
@@ -579,7 +579,7 @@ class JSModuleAnalyzer {
579579 let name = null ;
580580 if ( i < nArgs ) {
581581 const value = getStringValue ( args [ i ] ) ;
582- if ( value ) {
582+ if ( value !== undefined ) {
583583 name = ModuleName . fromRequireJSName ( value ) ;
584584 if ( name === defaultName ) {
585585 // hardcoded name equals the file name, so this definition qualifies as main module definition
@@ -629,21 +629,21 @@ class JSModuleAnalyzer {
629629 for ( let i = 0 ; i < nArgs ; i ++ ) {
630630 const arg = args [ i ] ;
631631 const value = getStringValue ( arg ) ;
632- if ( value ) {
632+ if ( value !== undefined ) {
633633 const requiredModuleName = ModuleName . fromUI5LegacyName ( value ) ;
634634 info . addDependency ( requiredModuleName , conditional ) ;
635635 } else if ( arg . type == Syntax . ConditionalExpression ) {
636636 const consequentValue = getStringValue ( arg . consequent ) ;
637637 const alternateValue = getStringValue ( arg . alternate ) ;
638- if ( consequentValue ) {
638+ if ( consequentValue !== undefined ) {
639639 const requiredModuleName1 = ModuleName . fromUI5LegacyName ( consequentValue ) ;
640640 info . addDependency ( requiredModuleName1 , true ) ;
641641 }
642- if ( alternateValue ) {
642+ if ( alternateValue !== undefined ) {
643643 const requiredModuleName2 = ModuleName . fromUI5LegacyName ( alternateValue ) ;
644644 info . addDependency ( requiredModuleName2 , true ) ;
645645 }
646- if ( ! consequentValue || ! alternateValue ) {
646+ if ( consequentValue === undefined || alternateValue === undefined ) {
647647 log . verbose ( "jQuery.sap.require: cannot evaluate dynamic arguments: " , arg && arg . type ) ;
648648 info . dynamicDependencies = true ;
649649 }
@@ -662,7 +662,7 @@ class JSModuleAnalyzer {
662662
663663 if ( i < nArgs ) {
664664 const value = getStringValue ( args [ i ] ) ;
665- if ( value ) {
665+ if ( value !== undefined ) {
666666 // sap.ui.requireSync does not support relative dependencies
667667 const moduleName = ModuleName . fromRequireJSName ( value ) ;
668668 info . addDependency ( moduleName , conditional ) ;
@@ -681,7 +681,7 @@ class JSModuleAnalyzer {
681681 // determine the name of the module
682682 if ( i < nArgs ) {
683683 const value = getStringValue ( args [ i ++ ] ) ;
684- if ( value ) {
684+ if ( value !== undefined ) {
685685 const moduleName = ModuleName . fromRequireJSName ( value ) ;
686686 info . addSubModule ( moduleName ) ;
687687
@@ -740,7 +740,7 @@ class JSModuleAnalyzer {
740740 // console.log(array);
741741 array . forEach ( ( item ) => {
742742 const value = getStringValue ( item ) ;
743- if ( value ) {
743+ if ( value !== undefined ) {
744744 // ignore special AMD dependencies (require, exports, module)
745745 if ( SPECIAL_AMD_DEPENDENCIES . indexOf ( value ) >= 0 ) {
746746 return ;
0 commit comments