(requireCall, conditional)
| 614 | } |
| 615 | |
| 616 | function onJQuerySapRequire(requireCall, conditional) { |
| 617 | const args = requireCall.arguments; |
| 618 | const nArgs = args.length; |
| 619 | |
| 620 | if ( nArgs > 0 && args[0].type == Syntax.OBJECT ) { |
| 621 | log.verbose("jQuery.sap.require: Cannot evaluate complex require (view/controller)"); |
| 622 | } else { |
| 623 | // UI5 signature with one or many required modules |
| 624 | for (let i = 0; i < nArgs; i++) { |
| 625 | const arg = args[i]; |
| 626 | const value = getStringValue(arg); |
| 627 | if ( value !== undefined ) { |
| 628 | const requiredModuleName = fromUI5LegacyName( value ); |
| 629 | info.addDependency(requiredModuleName, conditional); |
| 630 | } else if ( arg.type == Syntax.ConditionalExpression) { |
| 631 | const consequentValue = getStringValue(arg.consequent); |
| 632 | const alternateValue = getStringValue(arg.alternate); |
| 633 | if ( consequentValue !== undefined ) { |
| 634 | const requiredModuleName1 = fromUI5LegacyName( consequentValue ); |
| 635 | info.addDependency(requiredModuleName1, true); |
| 636 | } |
| 637 | if ( alternateValue !== undefined ) { |
| 638 | const requiredModuleName2 = fromUI5LegacyName( alternateValue ); |
| 639 | info.addDependency(requiredModuleName2, true); |
| 640 | } |
| 641 | if ( consequentValue === undefined || alternateValue === undefined ) { |
| 642 | log.verbose(`jQuery.sap.require: Cannot evaluate dynamic arguments: ${arg && arg.type}`); |
| 643 | info.dynamicDependencies = true; |
| 644 | } |
| 645 | } else { |
| 646 | log.verbose(`jQuery.sap.require: Cannot evaluate dynamic arguments: ${arg && arg.type}`); |
| 647 | info.dynamicDependencies = true; |
| 648 | } |
| 649 | } |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | function onSapUiRequireSync(node, conditional) { |
| 654 | const args = node.arguments; |
nothing calls this directly
no test coverage detected