├── .chglog
├── CHANGELOG.tpl.md
├── RELEASE.tpl.md
├── config.yml
└── release-config.yml
├── .clang-format
├── .editorconfig
├── .eslintignore
├── .eslintrc.json
├── .gitattributes
├── .github
├── dependabot.yml
└── workflows
│ └── reuse-compliance.yml
├── .gitignore
├── .prettierignore
├── .prettierrc.js
├── .reuse
└── dep5
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE.txt
├── LICENSES
└── Apache-2.0.txt
├── README.md
├── SECURITY.md
├── azure-pipelines.yml
├── bin
└── cli.js
├── defaultConfig
├── AmdCleaner.config.json
├── addMissingDependencies.config.json
├── addRenderers.config.json
├── fixTypeDependency.config.json
├── printer.config.json
├── replaceGlobals.config.json
└── variableNamePrettifier.config.json
├── docs
├── Guidelines.md
├── guide
│ ├── cli.md
│ ├── migrationguide.md
│ ├── print.md
│ └── tasks.md
├── images
│ └── UI5_logo_wide.png
├── index.html
└── troubleshooting.md
├── index.js
├── npm-shrinkwrap.json
├── package.json
├── rfcs
└── 0000-template.md
├── src
├── Migration.ts
├── cli.ts
├── dependencies.ts
├── index.ts
├── reporter
│ ├── BaseReporter.ts
│ ├── ConsoleReporter.ts
│ ├── JSONReporter.ts
│ ├── MetaConsoleReporter.ts
│ └── Reporter.ts
├── taskRunner.ts
├── tasks
│ ├── addMissingDependencies.ts
│ ├── addRenderers.ts
│ ├── amdCleanup.ts
│ ├── fixTypeDependency.ts
│ ├── helpers
│ │ ├── extenders
│ │ │ ├── AddImport.ts
│ │ │ ├── AddUnusedImport.ts
│ │ │ ├── AddUnusedImportWithComment.ts
│ │ │ ├── JQueryDependencyCleanupExtender.ts
│ │ │ └── LeaveImport.ts
│ │ ├── finders
│ │ │ ├── AssignReplacementFinder.ts
│ │ │ ├── CallWithArgumentFinder.ts
│ │ │ ├── CallWithArgumentFinderWithDependencyCheck.ts
│ │ │ ├── FunctionExtensionFinder.ts
│ │ │ ├── FunctionExtensionFinderWithDependencyCheck.ts
│ │ │ ├── GlobalCoreConfigurationFinder.ts
│ │ │ ├── JQueryControlCallFinder.ts
│ │ │ ├── JQueryDOMVariableNameFinder.ts
│ │ │ ├── JQueryEventExtensionFinder.ts
│ │ │ ├── JQueryFunctionExtensionFinder.ts
│ │ │ ├── JQueryFunctionExtensionFinderWithDependencyCheck.ts
│ │ │ ├── JQuerySapCallFinder.ts
│ │ │ ├── JQuerySapExtendFinder.ts
│ │ │ ├── JQuerySapFunctionFinder.ts
│ │ │ ├── NewExpressionFinder.ts
│ │ │ └── UriParametersWithURLFinder.ts
│ │ └── replacers
│ │ │ ├── AddComment.ts
│ │ │ ├── Call.ts
│ │ │ ├── DelayedCall.ts
│ │ │ ├── GenNOOP.ts
│ │ │ ├── GetObject.ts
│ │ │ ├── Getter.ts
│ │ │ ├── IntervalCall.ts
│ │ │ ├── LEAVE.ts
│ │ │ ├── Module.ts
│ │ │ ├── ModuleFunction.ts
│ │ │ ├── ModuleFunctionPadding.ts
│ │ │ ├── ModuleFunctionWithObjectProperty.ts
│ │ │ ├── ModuleFunctionWithObjectPropertyComparison.ts
│ │ │ ├── ModuleSystem.ts
│ │ │ ├── ModuleWithInvocation.ts
│ │ │ ├── ModuleWithWindowScopedInvocation.ts
│ │ │ ├── NOOP.ts
│ │ │ ├── NativeFunction.ts
│ │ │ ├── NativeFunctionWithArgumentCheck.ts
│ │ │ ├── NativeInstanceFunction.ts
│ │ │ ├── NativeObject.ts
│ │ │ ├── NativeStringFunction.ts
│ │ │ ├── NewInstance.ts
│ │ │ ├── NewInstanceNoArgs.ts
│ │ │ ├── RemoveUrlWhitelist.ts
│ │ │ ├── RetinaSupport.ts
│ │ │ ├── SetObject.ts
│ │ │ ├── UI5ElementClosestTo.ts
│ │ │ ├── UriParameters.ts
│ │ │ ├── VariableNameReplacer.ts
│ │ │ ├── domById.ts
│ │ │ ├── domFocus.ts
│ │ │ ├── inArray.ts
│ │ │ ├── instanceOf.ts
│ │ │ ├── isMouseEventDelayed.ts
│ │ │ ├── jQueryContains.ts
│ │ │ ├── jQueryExtend.ts
│ │ │ ├── jQueryTrim.ts
│ │ │ ├── jqueryDomById.ts
│ │ │ ├── mergeOrObjectAssign.ts
│ │ │ ├── resourceModulePaths.ts
│ │ │ └── startsOrEndsWithIgnoreCase.ts
│ ├── replaceGlobals.ts
│ └── variableNamePrettifier.ts
└── util
│ ├── APIInfo.ts
│ ├── ASTUtils.ts
│ ├── ASTVisitor.ts
│ ├── AmdCleanerUtil.ts
│ ├── CLIUtils.ts
│ ├── CodeStyleAnalyzer.ts
│ ├── CommentUtils.ts
│ ├── ConfigUtils.ts
│ ├── FileFinder.ts
│ ├── FileInfo.ts
│ ├── FileUtils.ts
│ ├── FlattenTaskArray.ts
│ ├── LoaderUtils.ts
│ ├── ModuleNameComparator.ts
│ ├── NamespaceUtils.ts
│ ├── NoopFileFinder.ts
│ ├── Range.ts
│ ├── SapUiDefineCall.ts
│ ├── SapUiDefineCallUtils.ts
│ ├── StringFileInfo.ts
│ ├── TypeDependencyUtil.ts
│ ├── VariableNameCreator.ts
│ ├── file
│ ├── FileFilter.ts
│ ├── FolderFilter.ts
│ ├── FsFilter.ts
│ ├── FsFilterFactory.ts
│ ├── GlobFilter.ts
│ └── IgnoreFileFilter.ts
│ └── whitespace
│ ├── AstStringOptimizeStrategy.ts
│ ├── DiffAndAstStringOptimizeStrategy.ts
│ ├── DiffOptimizer.ts
│ ├── DiffStringOptimizeStrategy.ts
│ ├── MinimalDiffStringOptimizeStrategy.ts
│ ├── StringOptimizeStrategy.ts
│ └── StringWhitespaceUtils.ts
├── test
├── ModuleFinderTest.ts
├── addMissingDependencies
│ ├── addCommentToImport.config.json
│ ├── addCommentToImport.expected.js
│ ├── addCommentToImport.js
│ ├── control.config.json
│ ├── control.expected.js
│ ├── control.js
│ ├── coreConfiguration
│ │ ├── configuration.config.json
│ │ ├── configuration.expected.js
│ │ └── configuration.js
│ ├── event.config.json
│ ├── event.expected.js
│ ├── event.js
│ ├── findJQuerySapCalls.config.json
│ ├── findJQuerySapCalls.expected.js
│ ├── findJQuerySapCalls.js
│ ├── findJQuerySapExtendCalls.config.json
│ ├── findJQuerySapExtendCalls.expected.js
│ ├── findJQuerySapExtendCalls.js
│ ├── findJQuerySapFunctionCalls.config.json
│ ├── findJQuerySapFunctionCalls.expected.js
│ ├── findJQuerySapFunctionCalls.js
│ ├── invalidConfig.config.json
│ ├── invalidDefine.config.json
│ ├── invalidDefine.expected.js
│ ├── invalidDefine.js
│ ├── jquery-plugin-addAriaLabelledBy.config.json
│ ├── jquery-plugin-addAriaLabelledBy.expected.js
│ ├── jquery-plugin-addAriaLabelledBy.js
│ ├── multiple.config.json
│ ├── multiple.expected.js
│ ├── multiple.js
│ ├── pseudotypes.config.json
│ ├── pseudotypes.expected.js
│ ├── pseudotypes.js
│ ├── renaming.config.json
│ ├── renaming.expected.js
│ ├── renaming.js
│ ├── renamingVars.config.json
│ ├── renamingVars.expected.js
│ ├── renamingVars.js
│ ├── replaceJQuery
│ │ ├── control.config.json
│ │ ├── control.expected.js
│ │ └── control.js
│ ├── selector.config.json
│ ├── selector.expected.js
│ ├── selector.js
│ ├── test.config.json
│ ├── test.expected.js
│ ├── test.js
│ ├── test2.config.json
│ ├── test2.expected.js
│ ├── test2.js
│ ├── uriParamsInterim.config.json
│ ├── uriParamsInterim.expected.js
│ ├── uriParamsInterim.js
│ ├── variableReuse.config.json
│ ├── variableReuse.expected.js
│ ├── variableReuse.js
│ ├── zIndex.config.json
│ ├── zIndex.expected.js
│ ├── zIndex.js
│ ├── zIndexNoReplacement.config.json
│ ├── zIndexNoReplacement.expected.js
│ └── zIndexNoReplacement.js
├── addMissingDependenciesTest.ts
├── addRenderers
│ ├── invalidDefine.js
│ ├── myControl.expected.js
│ ├── myControl.js
│ ├── myControlRenderer.js
│ ├── myTestControlMetaRenderer.js
│ ├── myTestControlNoRenderer.expected.js
│ ├── myTestControlNoRenderer.js
│ ├── myTestControlNoRendererRenderer.js
│ └── myTestControlProtoRenderer.js
├── amdCleanup
│ ├── ComponentReturnModule.expected.js
│ ├── ComponentReturnModule.js
│ ├── ComponentReturnModuleAdv.expected.js
│ ├── ComponentReturnModuleAdv.js
│ ├── ModelReturnModule.api.json
│ ├── ModelReturnModule.expected.js
│ ├── ModelReturnModule.js
│ ├── ModelReturnModuleAdv.expected.js
│ ├── ModelReturnModuleAdv.js
│ ├── ModelReturnModuleFormat.api.json
│ ├── ModelReturnModuleFormat.expected.js
│ ├── ModelReturnModuleFormat.js
│ ├── _generic.api.json
│ ├── addComments.expected.js
│ ├── addComments.js
│ ├── comments.expected.js
│ ├── comments.js
│ ├── dashedImports.expected.js
│ ├── dashedImports.js
│ ├── dashedImportsSimple.expected.js
│ ├── dashedImportsSimple.js
│ ├── dateType.api.json
│ ├── dateType.expected.js
│ ├── dateType.js
│ ├── declare.expected.js
│ ├── declare.js
│ ├── declare2.expected.js
│ ├── declare2.js
│ ├── declareAndRequire.expected.js
│ ├── declareAndRequire.js
│ ├── declareWithExplicitGlobalReference.expected.js
│ ├── declareWithExplicitGlobalReference.js
│ ├── duplicateExportVar.api.json
│ ├── duplicateExportVar.expected.js
│ ├── duplicateExportVar.js
│ ├── duplicateImports.api.json
│ ├── duplicateImports.expected.js
│ ├── duplicateImports.js
│ ├── duplicateVar.expected.js
│ ├── duplicateVar.js
│ ├── emptyDefine.expected.js
│ ├── emptyDefine.js
│ ├── emptyDefineWithContent.api.json
│ ├── emptyDefineWithContent.expected.js
│ ├── emptyDefineWithContent.js
│ ├── emptyFile.api.json
│ ├── emptyFile.expected.js
│ ├── emptyFile.js
│ ├── excludes.api.json
│ ├── excludes.expected.js
│ ├── excludes.js
│ ├── excludes.ushell.api.json
│ ├── existingImport.expected.js
│ ├── existingImport.js
│ ├── existingVariables.expected.js
│ ├── existingVariables.js
│ ├── functionOnly.expected.js
│ ├── functionOnly.js
│ ├── genericApp.api.json
│ ├── genericApp.resources.json
│ ├── iife.expected.js
│ ├── iife.js
│ ├── iifeWrapper.expected.js
│ ├── iifeWrapper.js
│ ├── invalidDefine.expected.js
│ ├── invalidDefine.js
│ ├── jsdocDeclare.expected.js
│ ├── jsdocDeclare.js
│ ├── keepDependency.expected.js
│ ├── keepDependency.js
│ ├── library.api.json
│ ├── library.expected.js
│ ├── library.js
│ ├── memberExpression.expected.js
│ ├── memberExpression.js
│ ├── memberExpressionTop.expected.js
│ ├── memberExpressionTop.js
│ ├── modelFilter.api.json
│ ├── modelFilter.expected.js
│ ├── modelFilter.js
│ ├── objectPath.expected.js
│ ├── objectPath.js
│ ├── oneExtendCall.expected.js
│ ├── oneExtendCall.js
│ ├── plainModuleName.api.json
│ ├── plainModuleName.expected.js
│ ├── plainModuleName.js
│ ├── property.api.json
│ ├── property.expected.js
│ ├── property.js
│ ├── relative.api.json
│ ├── relative.expected.js
│ ├── relative.js
│ ├── require.expected.js
│ ├── require.js
│ ├── reservedKeywords.expected.js
│ ├── reservedKeywords.js
│ ├── singleStatement.api.json
│ ├── singleStatement.expected.js
│ ├── singleStatement.js
│ ├── twoStatements.expected.js
│ ├── twoStatements.js
│ ├── varvar.api.json
│ ├── varvar.expected.js
│ └── varvar.js
├── amdCleanupTest.ts
├── configTest.ts
├── fixTypeDependency
│ ├── _apiVersion.version.json
│ ├── _core.api.json
│ ├── _core.resources.json
│ ├── _layout.api.json
│ ├── _table.api.json
│ ├── invalidDefine.js
│ ├── library.expected.js
│ ├── library.js
│ ├── libraryDependency.api.json
│ ├── libraryDependency.js
│ ├── libraryNamespace.expected.js
│ ├── libraryNamespace.js
│ ├── multipleLibraries.expected.js
│ └── multipleLibraries.js
├── fixTypeDependencyTest.ts
├── indexTest.ts
├── renderTest.ts
├── replaceGlobals
│ ├── ModuleSystem.config.json
│ ├── ModuleSystem.expected.js
│ ├── ModuleSystem.js
│ ├── RisBundle.config.json
│ ├── RisBundle.expected.js
│ ├── RisBundle.js
│ ├── addcomment.config.json
│ ├── addcomment.expected.js
│ ├── addcomment.js
│ ├── assign.config.json
│ ├── assign.expected.js
│ ├── assign.js
│ ├── assignmodfunc.config.json
│ ├── assignmodfunc.expected.js
│ ├── assignmodfunc.js
│ ├── asterisk.config.json
│ ├── asterisk.expected.js
│ ├── asterisk.js
│ ├── comments.config.json
│ ├── comments.expected.js
│ ├── comments.js
│ ├── delay.config.json
│ ├── delay.expected.js
│ ├── delay.js
│ ├── domById.config.json
│ ├── domById.expected.js
│ ├── domById.js
│ ├── domFocus.config.json
│ ├── domFocus.expected.js
│ ├── domFocus.js
│ ├── duplicateVars.config.json
│ ├── duplicateVars.expected.js
│ ├── duplicateVars.js
│ ├── duplication.config.json
│ ├── duplication.expected.js
│ ├── duplication.js
│ ├── each.config.json
│ ├── each.expected.js
│ ├── each.js
│ ├── encodeXML.config.json
│ ├── encodeXML.expected.js
│ ├── encodeXML.js
│ ├── endsWith.config.json
│ ├── endsWith.expected.js
│ ├── endsWith.js
│ ├── endsWithIgnoreCase.config.json
│ ├── endsWithIgnoreCase.expected.js
│ ├── endsWithIgnoreCase.js
│ ├── extend.config.json
│ ├── extend.expected.js
│ ├── extend.js
│ ├── extendAndAssign.config.json
│ ├── extendAndAssign.expected.js
│ ├── extendAndAssign.js
│ ├── extendImport.config.json
│ ├── extendImport.expected.js
│ ├── extendImport.js
│ ├── gennoop.config.json
│ ├── gennoop.expected.js
│ ├── gennoop.js
│ ├── getObject.config.json
│ ├── getObject.expected.js
│ ├── getObject.js
│ ├── getter.config.json
│ ├── getter.expected.js
│ ├── getter.js
│ ├── inArray.config.json
│ ├── inArray.expected.js
│ ├── inArray.js
│ ├── inclusive.config.json
│ ├── inclusive158.expected.js
│ ├── inclusive158.js
│ ├── inclusive185.expected.js
│ ├── inclusive185.js
│ ├── inclusive190.expected.js
│ ├── inclusive190.js
│ ├── interval.expected.js
│ ├── interval.js
│ ├── intervalCall.config.json
│ ├── invalidDefine.config.json
│ ├── invalidDefine.expected.js
│ ├── invalidDefine.js
│ ├── isEqualNode.config.json
│ ├── isEqualNode.expected.js
│ ├── isEqualNode.js
│ ├── isMouseEventDelayed.config.json
│ ├── isMouseEventDelayed.expected.js
│ ├── isMouseEventDelayed.js
│ ├── isPlainObject.config.json
│ ├── isPlainObject.expected.js
│ ├── isPlainObject.js
│ ├── isPlainObject2.config.json
│ ├── isPlainObject2.expected.js
│ ├── isPlainObject2.js
│ ├── jQ.config.json
│ ├── jQ.expected.js
│ ├── jQ.js
│ ├── jQueryContains.config.json
│ ├── jQueryContains.expected.js
│ ├── jQueryContains.js
│ ├── jquery.config.json
│ ├── jquery.expected.js
│ ├── jquery.js
│ ├── jqueryDom.config.json
│ ├── jqueryDom.expected.js
│ ├── jqueryDom.js
│ ├── jqueryExtend.config.json
│ ├── jqueryExtend.expected.js
│ ├── jqueryExtend.js
│ ├── jqueryExtendSkipImport.config.json
│ ├── jqueryExtendSkipImport.expected.js
│ ├── jqueryExtendSkipImport.js
│ ├── jqueryExtendVars.config.json
│ ├── jqueryExtendVars.expected.js
│ ├── jqueryExtendVars.js
│ ├── jqueryThirdParty.config.json
│ ├── jqueryThirdParty.expected.js
│ ├── jqueryThirdParty.js
│ ├── jqueryTrim.config.json
│ ├── jqueryTrim.expected.js
│ ├── jqueryTrim.js
│ ├── jquerydeviceisiphone.config.json
│ ├── jquerydeviceisiphone.expected.js
│ ├── jquerydeviceisiphone.js
│ ├── jquerydeviceisstandalone.config.json
│ ├── jquerydeviceisstandalone.expected.js
│ ├── jquerydeviceisstandalone.js
│ ├── jqueryos.config.json
│ ├── jqueryos.expected.js
│ ├── jqueryos.invalid.require.config.json
│ ├── jqueryos.invalid.require.expected.js
│ ├── jqueryos.invalid.require.js
│ ├── jqueryos.js
│ ├── jqueryos.require.config.json
│ ├── jqueryos.require.expected.js
│ ├── jqueryos.require.js
│ ├── jqueryosname.config.json
│ ├── jqueryosname.expected.js
│ ├── jqueryosname.js
│ ├── jstokenizer.config.json
│ ├── jstokenizer.expected.js
│ ├── jstokenizer.js
│ ├── laterSapDefine.config.json
│ ├── laterSapDefine.expected.js
│ ├── laterSapDefine.js
│ ├── leave.config.json
│ ├── leave.expected.js
│ ├── leave.js
│ ├── loglevel.config.json
│ ├── loglevel.expected.js
│ ├── loglevel.js
│ ├── measure.config.json
│ ├── measure.expected.js
│ ├── measure.js
│ ├── missingDependency.config.json
│ ├── missingDependency.expected.js
│ ├── missingDependency.js
│ ├── mock.config.json
│ ├── mock.expected.js
│ ├── mock.js
│ ├── moduleWithInvoc.config.json
│ ├── moduleWithInvoc.expected.js
│ ├── moduleWithInvoc.js
│ ├── moduleWithScopedInvoc.config.json
│ ├── moduleWithScopedInvoc.expected.js
│ ├── moduleWithScopedInvoc.js
│ ├── multiversion.1.58.0.expected.js
│ ├── multiversion.config.json
│ ├── multiversion.expected.js
│ ├── multiversion.js
│ ├── nativeFunction.config.json
│ ├── nativeFunction.expected.js
│ ├── nativeFunction.js
│ ├── nativeFunctionArgCheck.config.json
│ ├── nativeFunctionArgCheck.expected.js
│ ├── nativeFunctionArgCheck.js
│ ├── nativeObject.config.json
│ ├── nativeObject.expected.js
│ ├── nativeObject.js
│ ├── nonRoot.config.json
│ ├── nonRoot.expected.js
│ ├── nonRoot.js
│ ├── padding.config.json
│ ├── padding.expected.js
│ ├── padding.js
│ ├── removeUrlWhitelist.config.json
│ ├── removeUrlWhitelist.expected.js
│ ├── removeUrlWhitelist.js
│ ├── resourceModulePaths.config.json
│ ├── resourceModulePaths.expected.js
│ ├── resourceModulePaths.js
│ ├── retina.config.json
│ ├── retina.expected.js
│ ├── retina.js
│ ├── reuseVar.config.json
│ ├── reuseVar.expected.js
│ ├── reuseVar.js
│ ├── sapextend.config.json
│ ├── sapextend.expected.js
│ ├── sapextend.js
│ ├── setObject.config.json
│ ├── setObject.expected.js
│ ├── setObject.js
│ ├── startsWithIgnoreCase.config.json
│ ├── startsWithIgnoreCase.expected.js
│ ├── startsWithIgnoreCase.js
│ ├── storage.config.json
│ ├── storage.expected.js
│ ├── storage.js
│ ├── testSpies.config.json
│ ├── testSpies.expected.js
│ ├── testSpies.js
│ ├── unset_global.config.json
│ ├── unset_global.expected.js
│ ├── unset_global.js
│ ├── unusedGlobals.config.json
│ ├── unusedGlobals.expected.js
│ ├── unusedGlobals.js
│ ├── uriParams.config.json
│ ├── uriParams.expected.js
│ ├── uriParams.js
│ ├── variableAssignment.config.json
│ ├── variableAssignment.expected.js
│ ├── variableAssignment.js
│ ├── version.config.json
│ ├── version.expected.js
│ ├── version.js
│ ├── versionReplacement.config.json
│ ├── versionReplacement.expected.js
│ └── versionReplacement.js
├── replaceGlobalsTest.ts
├── reporter
│ └── ReporterTest.ts
├── taskRunner
│ ├── file1.expected.js
│ ├── file1.js
│ ├── file2.expected.js
│ ├── file2.js
│ ├── jquery0.config.json
│ ├── jquery0.expected.js
│ └── jquery0.js
├── taskRunnerTest.ts
└── util
│ ├── ASTVisitor
│ └── genRandomJS.ts
│ ├── CLIUtilsTest.ts
│ ├── CodeStyleAnalyzerTest.ts
│ ├── ConfigUtilsTest.ts
│ ├── FileFinderTest.ts
│ ├── FileInfoTest.ts
│ ├── FlattenTaskArrayTest.ts
│ ├── LoaderUtilsTest.ts
│ ├── ModuleNameComparatorTest.ts
│ ├── NamespaceUtilTest.ts
│ ├── RangeTest.ts
│ ├── SapUiDefineCallTest.ts
│ ├── VariableNameCreatorTest.ts
│ ├── astvisitorTest.ts
│ ├── file
│ ├── FileFilterTest.ts
│ ├── FolderFilterTest.ts
│ ├── FsFilterFactoryTest.ts
│ ├── GlobFilterTest.ts
│ └── IgnoreFileFilterTest.ts
│ ├── testUtils.ts
│ └── whitespace
│ ├── AstStringOptimizeStrategyTest.ts
│ ├── DiffAndAstStringOptimizeStrategyTest.ts
│ ├── DiffStringOptimizeStrategyTest.ts
│ ├── astresources
│ ├── abap.expected.js
│ ├── abap.modified.js
│ ├── abap.source.js
│ ├── actions.expected.js
│ ├── actions.modified.js
│ ├── actions.source.js
│ ├── batch.expected.js
│ ├── batch.modified.js
│ ├── batch.source.js
│ ├── breaking.expected.js
│ ├── breaking.modified.js
│ ├── breaking.source.js
│ ├── comment.expected.js
│ ├── comment.modified.js
│ ├── comment.source.js
│ ├── custom.expected.js
│ ├── custom.modified.js
│ ├── custom.source.js
│ ├── list.expected.js
│ ├── list.modified.js
│ └── list.source.js
│ ├── diffandastresources
│ ├── abap.expected.js
│ ├── abap.modified.js
│ ├── abap.source.js
│ ├── actions.expected.js
│ ├── actions.modified.js
│ ├── actions.source.js
│ ├── batch.expected.js
│ ├── batch.modified.js
│ ├── batch.source.js
│ ├── endless.expected.js
│ ├── endless.modified.js
│ ├── endless.source.js
│ ├── list.expected.js
│ ├── list.modified.js
│ ├── list.source.js
│ ├── multiline.expected.js
│ ├── multiline.modified.js
│ ├── multiline.source.js
│ ├── multilineprop.expected.js
│ ├── multilineprop.modified.js
│ ├── multilineprop.source.js
│ ├── newlines.expected.js
│ ├── newlines.modified.js
│ ├── newlines.source.js
│ ├── structure.expected.js
│ ├── structure.modified.js
│ ├── structure.source.js
│ ├── structure2.expected.js
│ ├── structure2.modified.js
│ └── structure2.source.js
│ └── diffresources
│ ├── abap.expected.js
│ ├── abap.modified.js
│ ├── abap.source.js
│ ├── actions.expected.js
│ ├── actions.modified.js
│ ├── actions.source.js
│ ├── batch.expected.js
│ ├── batch.modified.js
│ ├── batch.source.js
│ ├── endless.expected.js
│ ├── endless.modified.js
│ ├── endless.source.js
│ ├── list.expected.js
│ ├── list.modified.js
│ ├── list.source.js
│ ├── structure.expected.js
│ ├── structure.modified.js
│ └── structure.source.js
├── tsconfig.json
└── typings
├── index.d.ts
└── recast.d.ts
/.editorconfig:
--------------------------------------------------------------------------------
1 | # see http://editorconfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = tab
8 |
9 | [*.{css,html,js,less,txt,json,yml,md}]
10 | trim_trailing_whitespace = true
11 | end_of_line = lf
12 | indent_size = 4
13 | insert_final_newline = true
14 |
15 | [*.yml]
16 | indent_style = space
17 | indent_size = 2
18 |
19 | [*.md]
20 | trim_trailing_whitespace = false
21 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | bin/
2 | # test files
3 | test/**/*.js
4 | # generated files
5 | js/
6 | # js files in source
7 | src/**/*.js
8 | typings/
9 | coverage
10 | index.js
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./node_modules/gts/",
3 | "env": {
4 | "node": true
5 | },
6 | "rules": {
7 | "no-debugger": 2,
8 | "no-irregular-whitespace": 2,
9 | "linebreak-style": [2, "unix"],
10 | "no-console": 2,
11 | "curly": 2,
12 | "no-prototype-builtins": 1,
13 | "quotes": [0, "double"],
14 | "@typescript-eslint/no-explicit-any": 1,
15 | "@typescript-eslint/no-this-alias": 2,
16 | "@typescript-eslint/no-unused-vars": [2, {"args": "none"}]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto eol=lf
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: npm
4 | directory: "/"
5 | schedule:
6 | interval: weekly
7 | day: sunday
8 | time: "10:00"
9 | timezone: Etc/UCT
10 | reviewers:
11 | - tobiasso85
12 | - svbender
13 | versioning-strategy: increase
14 |
--------------------------------------------------------------------------------
/.github/workflows/reuse-compliance.yml:
--------------------------------------------------------------------------------
1 | name: REUSE Compliance Check
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | test:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v2
10 | - name: REUSE Compliance Check
11 | uses: fsfe/reuse-action@v1.1
12 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | bin/
2 | js/
3 | src/**/*.js
4 | test/**/*.js
5 | typings/
6 | index.js
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | const gtsPrettier = require('gts/.prettierrc.json');
2 |
3 |
4 | module.exports = Object.assign({}, gtsPrettier, {
5 | tabWidth: 4,
6 | useTabs: true,
7 | printWidth: 80,
8 | singleQuote: false,
9 | bracketSpacing: false,
10 | endOfLine: "lf",
11 | trailingComma: 'es5',
12 | });
13 |
--------------------------------------------------------------------------------
/bin/cli.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | var CLI = require("../js/src/cli");
3 |
4 | process.on("unhandledRejection", (reason, p) => {
5 | console.log("Unhandled Rejection at:", p, "reason:", reason);
6 | });
7 |
8 | CLI.start().catch((err) => {
9 | console.error(err.message);
10 | // error causes program to exit with error status code
11 | process.exit(1);
12 | });
13 |
--------------------------------------------------------------------------------
/defaultConfig/AmdCleaner.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "rootPath": "https://sapui5.hana.ondemand.com/",
3 | "amd": {
4 | "addTodoForUnsafeReplacements": false,
5 | "onlySafeReplacements": false,
6 | "excludes": ["sap.ui.loader", "sap.ui.define", "sap.ui.require", "sap.ushell"]
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/defaultConfig/addRenderers.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "addRendererField": false
3 | }
--------------------------------------------------------------------------------
/defaultConfig/fixTypeDependency.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "rootPath": "https://sapui5.hana.ondemand.com/",
3 | "amd": {
4 | "addTodoForUnsafeReplacements": false,
5 | "onlySafeReplacements": false
6 | }
7 | }
--------------------------------------------------------------------------------
/defaultConfig/printer.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "tabWidth": 4,
3 | "useTabs": true,
4 | "reuseWhitespace": true,
5 | "lineTerminator": "\n",
6 | "wrapColumn": 120,
7 | "quote": "double",
8 | "auto.lineTerminator": true,
9 | "auto.useTabs": true,
10 | "auto.diffOptimization": "DiffAndAstStringOptimizeStrategy"
11 | }
--------------------------------------------------------------------------------
/docs/images/UI5_logo_wide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/ui5-migration/36ba9b5b49907ad330dbe99dd67e80c743434172/docs/images/UI5_logo_wide.png
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | UI5-Migration Redirect
4 |
5 |
11 |
12 |
13 | Redirect
14 | If you are not redirected automatically, please follow this link.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require("./js/src/index");
2 |
--------------------------------------------------------------------------------
/src/Migration.ts:
--------------------------------------------------------------------------------
1 | export {
2 | AnalyseArguments,
3 | ASTReplaceable,
4 | FileFinder,
5 | FileInfo,
6 | MigrateArguments,
7 | NodePath,
8 | Task,
9 | TaskExtra,
10 | TNodePath,
11 | VisitorFunctions,
12 | } from "ui5-migration";
13 | export {ConsoleReporter} from "./reporter/ConsoleReporter";
14 | export {JSONReporter} from "./reporter/JSONReporter";
15 | export {Reporter, ReportLevel} from "./reporter/Reporter";
16 | export {ASTVisitor} from "./util/ASTVisitor";
17 |
--------------------------------------------------------------------------------
/src/tasks/helpers/extenders/AddImport.ts:
--------------------------------------------------------------------------------
1 | import {Extender} from "../../../dependencies";
2 | import {SapUiDefineCall} from "../../../util/SapUiDefineCall";
3 |
4 | /**
5 | * Adds an import to the define statement
6 | */
7 | class AddImport implements Extender {
8 | extend(
9 | defineCall: SapUiDefineCall,
10 | config: {
11 | newModulePath: string;
12 | newVariableName: string;
13 | }
14 | ): boolean {
15 | return defineCall.addDependency(
16 | config.newModulePath,
17 | config.newVariableName
18 | );
19 | }
20 | }
21 |
22 | module.exports = new AddImport();
23 |
--------------------------------------------------------------------------------
/src/tasks/helpers/extenders/AddUnusedImport.ts:
--------------------------------------------------------------------------------
1 | import {Extender} from "../../../dependencies";
2 | import {SapUiDefineCall} from "../../../util/SapUiDefineCall";
3 |
4 | class AddUnusedImportExtender implements Extender {
5 | extend(
6 | defineCall: SapUiDefineCall,
7 | config: {newModulePath: string}
8 | ): boolean {
9 | return defineCall.addDependency(config.newModulePath);
10 | }
11 | }
12 |
13 | module.exports = new AddUnusedImportExtender();
14 |
--------------------------------------------------------------------------------
/src/tasks/helpers/extenders/LeaveImport.ts:
--------------------------------------------------------------------------------
1 | import {Extender} from "../../../dependencies";
2 | import {SapUiDefineCall} from "../../../util/SapUiDefineCall";
3 |
4 | class LeaveImportExtender implements Extender {
5 | /**
6 | *
7 | * @param {SapUiDefineCall} defineCall
8 | * @param config
9 | * @returns {boolean}
10 | */
11 | extend(defineCall: SapUiDefineCall, config: {}): boolean {
12 | return true;
13 | }
14 | }
15 |
16 | module.exports = new LeaveImportExtender();
17 |
--------------------------------------------------------------------------------
/src/tasks/helpers/replacers/LEAVE.ts:
--------------------------------------------------------------------------------
1 | import {ASTReplaceable, NodePath} from "ui5-migration";
2 |
3 | /**
4 | *
5 | * @param {recast.NodePath} node The top node of the module reference
6 | * @param {string} name The name of the new module
7 | * @param {string} fnName The name of the function inside the new module
8 | * @param {string} oldModuleCall The old import name
9 | * @returns {void}
10 | */
11 | const replaceable: ASTReplaceable = {
12 | replace(
13 | node: NodePath,
14 | name: string,
15 | fnName: string,
16 | oldModuleCall: string
17 | ): void {
18 | throw new Error("Ignore");
19 | },
20 | };
21 |
22 | module.exports = replaceable;
23 |
--------------------------------------------------------------------------------
/src/tasks/helpers/replacers/NOOP.ts:
--------------------------------------------------------------------------------
1 | import {ASTReplaceable, NodePath} from "ui5-migration";
2 |
3 | /**
4 | *
5 | * @param {recast.NodePath} node The top node of the module reference
6 | * @param {string} name The name of the new module
7 | * @param {string} fnName The name of the function inside the new module
8 | * @param {string} oldModuleCall The old import name
9 | * @returns {void}
10 | */
11 | const replaceable: ASTReplaceable = {
12 | replace(
13 | node: NodePath,
14 | name: string,
15 | fnName: string,
16 | oldModuleCall: string
17 | ): void {
18 | // Does nothing (as expected)
19 | },
20 | };
21 |
22 | module.exports = replaceable;
23 |
--------------------------------------------------------------------------------
/src/util/CLIUtils.ts:
--------------------------------------------------------------------------------
1 | import {NamespaceConfig} from "../index";
2 |
3 | /**
4 | * Parse given namespace object and retrieves parsed namespace config
5 | * @param {string[]} namespaceInput, e.g. ["a.b.c:src", "x.y.z:./"]
6 | * @returns {NamespaceConfig[]} e.g. [
7 | { namespace : "a.b.c", filePath : "src" },
8 | { namespace : "d.e.f", filePath : "./" }
9 | ]
10 | */
11 | export function parseNamespaces(namespaceInput: string[]): NamespaceConfig[] {
12 | return namespaceInput.map(sEntry => {
13 | const aParts = sEntry.split(":");
14 | return {namespace: aParts[0], filePath: aParts[1]};
15 | });
16 | }
17 |
--------------------------------------------------------------------------------
/src/util/NoopFileFinder.ts:
--------------------------------------------------------------------------------
1 | import * as Mod from "../Migration";
2 | import {FileInfo} from "./FileInfo";
3 |
4 | export class NoopFileFinder implements Mod.FileFinder {
5 | findByPath(path: string): Promise {
6 | return undefined;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/util/file/FileFilter.ts:
--------------------------------------------------------------------------------
1 | import {FsFilter} from "./FsFilter";
2 |
3 | /**
4 | * Matches a file
5 | */
6 | export class FileFilter implements FsFilter {
7 | private sFolder: string;
8 | private sFile: string;
9 | constructor(sFolder: string, sFile: string) {
10 | this.sFolder = sFolder;
11 | this.sFile = sFile;
12 | }
13 | match(sFile: string): boolean {
14 | return sFile === this.sFile;
15 | }
16 | getDir(): string {
17 | return this.sFolder;
18 | }
19 |
20 | static create(sFolder: string, sFile: string) {
21 | return new FileFilter(sFolder, sFile);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/util/file/FolderFilter.ts:
--------------------------------------------------------------------------------
1 | import {FsFilter} from "./FsFilter";
2 |
3 | /**
4 | * Matches a folder
5 | */
6 | export class FolderFilter implements FsFilter {
7 | private sFolder: string;
8 | constructor(sFolder: string) {
9 | this.sFolder = sFolder;
10 | }
11 | match(sFile: string): boolean {
12 | return sFile.startsWith(this.sFolder);
13 | }
14 | getDir(): string {
15 | return this.sFolder;
16 | }
17 |
18 | static create(sFolder: string) {
19 | return new FolderFilter(sFolder);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/util/file/FsFilter.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Represents a file system filter
3 | */
4 | export interface FsFilter {
5 | match(sFile: string): boolean;
6 | getDir(): string;
7 | }
8 |
--------------------------------------------------------------------------------
/src/util/whitespace/DiffOptimizer.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Optimizes the diff between 2 strings regarding whitespaces
3 | */
4 | import {Reporter} from "../../reporter/Reporter";
5 |
6 | import {DiffAndAstStringOptimizeStrategy} from "./DiffAndAstStringOptimizeStrategy";
7 | import {StringOptimizeStrategy} from "./StringOptimizeStrategy";
8 |
9 | export async function optimizeString(
10 | original: string,
11 | modified: string,
12 | oReporter?: Reporter,
13 | strategy: StringOptimizeStrategy = new DiffAndAstStringOptimizeStrategy(
14 | oReporter
15 | )
16 | ): Promise {
17 | return strategy.optimizeString(original, modified);
18 | }
19 |
--------------------------------------------------------------------------------
/src/util/whitespace/StringOptimizeStrategy.ts:
--------------------------------------------------------------------------------
1 | export interface StringOptimizeStrategy {
2 | /**
3 | *
4 | * @param original
5 | * @param modified
6 | */
7 | optimizeString(original: string, modified: string): Promise;
8 | }
9 |
--------------------------------------------------------------------------------
/test/addMissingDependencies/addCommentToImport.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([/* My Test comment*/
7 | "sap/ui/dom/jquery/control"],
8 | function() {
9 | "use strict";
10 |
11 | /**
12 | *
13 | * @type {{}}
14 | */
15 | var A = {};
16 |
17 | /**
18 | *
19 | * @param oParam
20 | * @param sContent
21 | */
22 | A.x = function (oParam, sContent) {
23 |
24 | if (oParam.control(0)) {
25 | var sKey = "Test." + iconName + oParam.control;
26 | if (iconInfo.resourceBundle.hasText(sKey)) {
27 | $(sKey).control();
28 | }
29 | var x$ = sKey();
30 | x$.control();
31 | }
32 | };
33 |
34 | return A;
35 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/addCommentToImport.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName + oParam.control;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).control();
27 | }
28 | var x$ = sKey();
29 | x$.control();
30 | }
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/control.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "GLOBALS": {
4 | "*.control": {
5 | "newModulePath": "sap/ui/dom/jquery/control",
6 | "replacer": "NOOP",
7 | "finder": "JQueryFunctionExtensionFinder",
8 | "extender": "AddUnusedImport"
9 | }
10 | }
11 | },
12 | "finders": {
13 | "JQueryFunctionExtensionFinder": "tasks/helpers/finders/JQueryFunctionExtensionFinder.js"
14 | },
15 | "extenders": {
16 | "AddUnusedImport": "tasks/helpers/extenders/AddUnusedImport.js"
17 | },
18 | "replacers": {
19 | "NOOP": "tasks/helpers/replacers/NOOP.js"
20 | },
21 | "comments": {
22 | "unhandledReplacementComment": "TODO unhandled replacement"
23 | },
24 | "excludes": []
25 | }
--------------------------------------------------------------------------------
/test/addMissingDependencies/control.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/dom/jquery/control"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName + oParam.control;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).control();
27 | }
28 | var x$ = sKey();
29 | x$.control();
30 | }
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/control.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName + oParam.control;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).control();
27 | }
28 | var x$ = sKey();
29 | x$.control();
30 | }
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/event.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jQuery.Event.prototype": {
4 | "*.getOffsetX": {
5 | "newModulePath": "sap/ui/events/jquery/EventExtension",
6 | "replacer": "NOOP",
7 | "finder": "JQueryEventExtensionFinder",
8 | "finderIncludesName": "event",
9 | "extender": "AddUnusedImport"
10 | }
11 | }
12 | },
13 | "finders": {
14 | "JQueryEventExtensionFinder": "tasks/helpers/finders/JQueryEventExtensionFinder.js"
15 | },
16 | "extenders": {
17 | "AddUnusedImport": "tasks/helpers/extenders/AddUnusedImport.js"
18 | },
19 | "replacers": {
20 | "NOOP": "tasks/helpers/replacers/NOOP.js"
21 | },
22 | "comments": {
23 | "unhandledReplacementComment": "TODO unhandled replacement"
24 | },
25 | "excludes": []
26 | }
--------------------------------------------------------------------------------
/test/addMissingDependencies/event.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/events/jquery/EventExtension"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param oEvent
20 | */
21 | A.x = function (oParam, oEvent) {
22 | var x = oEvent.getOffsetX();
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).getOffsetX();
27 | event.getOffsetX();
28 | oParam.getOffsetX();
29 | }
30 | }
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/event.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param oEvent
20 | */
21 | A.x = function (oParam, oEvent) {
22 | var x = oEvent.getOffsetX();
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).getOffsetX();
27 | event.getOffsetX();
28 | oParam.getOffsetX();
29 | }
30 | }
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/findJQuerySapCalls.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "Find jQuery SAP calls": {
4 | "jQuery.sap.extend": {
5 | "replacer": "NOOP",
6 | "finder": "JQuerySapCallFinder",
7 | "extender": "LeaveImport",
8 | "version": "1.58.0"
9 | }
10 | }
11 | },
12 | "finders": {
13 | "JQuerySapCallFinder": "tasks/helpers/finders/JQuerySapCallFinder.js"
14 | },
15 | "extenders": {
16 | "LeaveImport": "tasks/helpers/extenders/LeaveImport.js"
17 | },
18 | "replacers": {
19 | "NOOP": "tasks/helpers/replacers/NOOP.js"
20 | },
21 | "comments": {
22 | "unhandledReplacementComment": "TODO unhandled replacement"
23 | },
24 | "excludes": []
25 | }
--------------------------------------------------------------------------------
/test/addMissingDependencies/findJQuerySapExtendCalls.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "Find jQuery SAP calls": {
4 | "jQuery.sap.extend": {
5 | "replacer": "NOOP",
6 | "finder": "JQuerySapExtendFinder",
7 | "extender": "LeaveImport",
8 | "version": "1.58.0"
9 | }
10 | }
11 | },
12 | "finders": {
13 | "JQuerySapExtendFinder": "tasks/helpers/finders/JQuerySapExtendFinder.js"
14 | },
15 | "extenders": {
16 | "LeaveImport": "tasks/helpers/extenders/LeaveImport.js"
17 | },
18 | "replacers": {
19 | "NOOP": "tasks/helpers/replacers/NOOP.js"
20 | },
21 | "comments": {
22 | "unhandledReplacementComment": "TODO unhandled replacement"
23 | },
24 | "excludes": []
25 | }
--------------------------------------------------------------------------------
/test/addMissingDependencies/findJQuerySapExtendCalls.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.sap.extend({}, oParam.obj)){
23 | oParam(sContent);
24 | }
25 | };
26 |
27 | return A;
28 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/findJQuerySapExtendCalls.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.sap.extend({}, oParam.obj)){
23 | oParam(sContent);
24 | }
25 | };
26 |
27 | return A;
28 | }, /* bExport= */ true);
29 |
--------------------------------------------------------------------------------
/test/addMissingDependencies/findJQuerySapFunctionCalls.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "Find jQuery SAP calls": {
4 | "jQuery.sap.extend": {
5 | "replacer": "NOOP",
6 | "finder": "JQuerySapFunctionFinder",
7 | "extender": "LeaveImport",
8 | "version": "1.58.0"
9 | }
10 | }
11 | },
12 | "finders": {
13 | "JQuerySapFunctionFinder": "tasks/helpers/finders/JQuerySapFunctionFinder.js"
14 | },
15 | "extenders": {
16 | "LeaveImport": "tasks/helpers/extenders/LeaveImport.js"
17 | },
18 | "replacers": {
19 | "NOOP": "tasks/helpers/replacers/NOOP.js"
20 | },
21 | "comments": {
22 | "unhandledReplacementComment": "TODO unhandled replacement"
23 | },
24 | "excludes": []
25 | }
--------------------------------------------------------------------------------
/test/addMissingDependencies/findJQuerySapFunctionCalls.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.sap.extend({}, oParam.obj)){
23 | oParam(sContent);
24 | }
25 | };
26 |
27 | return A;
28 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/findJQuerySapFunctionCalls.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.sap.extend({}, oParam.obj)){
23 | oParam(sContent);
24 | }
25 | };
26 |
27 | return A;
28 | }, /* bExport= */ true);
29 |
--------------------------------------------------------------------------------
/test/addMissingDependencies/invalidConfig.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "GLOBALS": {
4 | "*.control": {
5 | "newModulePath": "sap/ui/dom/jquery/control",
6 | "replacer": "NOOP",
7 | "finder": "JQueryFunctionExtensionFinder",
8 | "extender": "AddUnusedImport"
9 | }
10 | }
11 | },
12 | "finders": {
13 | },
14 | "extenders": {
15 | "AddUnusedImport": "tasks/helpers/extenders/AddUnusedImport.js"
16 | },
17 | "replacers": {
18 | "NOOP": "tasks/helpers/replacers/NOOP.js"
19 | },
20 | "comments": {
21 | "unhandledReplacementComment": "TODO unhandled replacement"
22 | },
23 | "excludes": []
24 | }
--------------------------------------------------------------------------------
/test/addMissingDependencies/invalidDefine.expected.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("gs.fin.definestatutoryreportss1.model.Download");
2 | sap.ui.define([
3 | "gs/fin/definestatutoryreportss1/controller/BaseController",
4 | "sap/ui/model/json/JSONModel"
5 | ],
6 | gs.fin.definestatutoryreportss1.model.Download = {
7 | yeyo: function() {
8 | $event.getPseudoTypes();
9 | }
10 | });
--------------------------------------------------------------------------------
/test/addMissingDependencies/invalidDefine.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("gs.fin.definestatutoryreportss1.model.Download");
2 | sap.ui.define([
3 | "gs/fin/definestatutoryreportss1/controller/BaseController",
4 | "sap/ui/model/json/JSONModel"
5 | ],
6 | gs.fin.definestatutoryreportss1.model.Download = {
7 | yeyo: function() {
8 | $event.getPseudoTypes();
9 | }
10 | });
--------------------------------------------------------------------------------
/test/addMissingDependencies/jquery-plugin-addAriaLabelledBy.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "./library",
3 | 'sap/ui/core/Core',
4 | "sap/ui/core/Item",
5 | 'sap/ui/core/Icon',
6 | 'sap/ui/core/IconPool',
7 | /* jQuery Plugin "addAriaLabelledBy"*/
8 | "sap/ui/dom/jquery/Aria"
9 | ],
10 | function(library, Core, Item, Icon, IconPool) {
11 | "use strict";
12 |
13 | // jQuery Plugin "addAriaLabelledBy"
14 | return $a.addAriaLabelledBy("");
15 | });
--------------------------------------------------------------------------------
/test/addMissingDependencies/jquery-plugin-addAriaLabelledBy.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["./library", 'sap/ui/core/Core', "sap/ui/core/Item", 'sap/ui/core/Icon', 'sap/ui/core/IconPool'],
2 | function(library, Core, Item, Icon, IconPool) {
3 | "use strict";
4 |
5 | return $a.addAriaLabelledBy("");
6 | });
--------------------------------------------------------------------------------
/test/addMissingDependencies/multiple.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName + oParam.control;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).control();
27 | }
28 | var x$ = sKey();
29 | x$.control();
30 | }
31 | var oEvent = oParam.getEvent();
32 | oEvent.getPseudoTypes();
33 | };
34 |
35 | return A;
36 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/pseudotypes.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/events/jquery/EventExtension"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param oEvent
20 | */
21 | A.x = function (oParam, oEvent) {
22 |
23 | if (oEvent.getPseudoTypes()) {
24 | var sKey = "Test." + iconName;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).getPseudoTypes();
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/pseudotypes.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param oEvent
20 | */
21 | A.x = function (oParam, oEvent) {
22 |
23 | if (oEvent.getPseudoTypes()) {
24 | var sKey = "Test." + iconName;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).getPseudoTypes();
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/replaceJQuery/control.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "GLOBALS": {
4 | "*.control": {
5 | "newModulePath": "sap/ui/core/Element",
6 | "newVariableName": "UI5Element",
7 | "replacer": "UI5ElementClosestTo",
8 | "finder": "JQueryControlCallFinder",
9 | "extender": "AddImport"
10 | }
11 | }
12 | },
13 | "finders": {
14 | "JQueryControlCallFinder": "tasks/helpers/finders/JQueryControlCallFinder.js"
15 | },
16 | "extenders": {
17 | "AddImport": "tasks/helpers/extenders/AddImport.js"
18 | },
19 | "replacers": {
20 | "UI5ElementClosestTo": "tasks/helpers/replacers/UI5ElementClosestTo.js"
21 | },
22 | "comments": {
23 | "unhandledReplacementComment": "TODO unhandled replacement"
24 | },
25 | "excludes": []
26 | }
--------------------------------------------------------------------------------
/test/addMissingDependencies/selector.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jQuery Selectors": {
4 | ":sapTabbable": {
5 | "newModulePath": "sap/ui/dom/jquery/Selectors",
6 | "replacer": "NOOP",
7 | "finder": "CallWithArgumentFinder",
8 | "finderIncludesName": ":sapTabbable",
9 | "extender": "AddUnusedImport"
10 | }
11 | }
12 | },
13 | "finders": {
14 | "CallWithArgumentFinder": "tasks/helpers/finders/CallWithArgumentFinder.js"
15 | },
16 | "extenders": {
17 | "AddUnusedImport": "tasks/helpers/extenders/AddUnusedImport.js"
18 | },
19 | "replacers": {
20 | "NOOP": "tasks/helpers/replacers/NOOP.js"
21 | },
22 | "comments": {
23 | "unhandledReplacementComment": "TODO unhandled replacement"
24 | },
25 | "excludes": []
26 | }
--------------------------------------------------------------------------------
/test/addMissingDependencies/test.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "GLOBALS": {
4 | "*.control": {
5 | "newModulePath": "sap/ui/dom/jquery/control",
6 | "replacer": "NOOP",
7 | "finder": "FunctionExtensionFinder",
8 | "extender": "AddUnusedImport"
9 | }
10 | }
11 | },
12 | "finders": {
13 | "FunctionExtensionFinder": "tasks/helpers/finders/FunctionExtensionFinder.js"
14 | },
15 | "extenders": {
16 | "AddUnusedImport": "tasks/helpers/extenders/AddUnusedImport.js"
17 | },
18 | "replacers": {
19 | "NOOP": "tasks/helpers/replacers/NOOP.js"
20 | },
21 | "comments": {
22 | "unhandledReplacementComment": "TODO unhandled replacement"
23 | },
24 | "excludes": []
25 | }
--------------------------------------------------------------------------------
/test/addMissingDependencies/test.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/dom/jquery/control"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).testore();
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/test.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).testore();
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/test2.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "GLOBALS": {
4 | "*.control": {
5 | "newModulePath": "sap/ui/dom/jquery/control",
6 | "replacer": "NOOP",
7 | "finder": "FunctionExtensionFinder",
8 | "extender": "AddUnusedImport"
9 | }
10 | }
11 | },
12 | "finders": {
13 | "FunctionExtensionFinder": "tasks/helpers/finders/FunctionExtensionFinder.js"
14 | },
15 | "extenders": {
16 | "AddUnusedImport": "tasks/helpers/extenders/AddUnusedImport.js"
17 | },
18 | "replacers": {
19 | "NOOP": "tasks/helpers/replacers/NOOP.js"
20 | },
21 | "comments": {
22 | "unhandledReplacementComment": "TODO unhandled replacement"
23 | },
24 | "excludes": []
25 | }
--------------------------------------------------------------------------------
/test/addMissingDependencies/test2.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/dom/jquery/control"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.testore(0)) {
24 | var sKey = "Test." + iconName;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).control();
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/test2.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.testore(0)) {
24 | var sKey = "Test." + iconName;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).control();
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/uriParamsInterim.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/util/UriParameters"],
7 | function(UriParameters) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param oEvent
20 | */
21 | A.x = function (oParam, oEvent) {
22 |
23 | new UriParameters(oEvent);
24 | new UriParameters();
25 | new UriParameters(window.location.href);
26 | new UriParameters(window.location.search);
27 |
28 | var x = new UriParameters(window.location.href);
29 | return new UriParameters(window.location.href || oEvent);
30 | };
31 |
32 | return A;
33 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/variableReuse.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["m/mymod","x/y/z"],
7 | function(myModule, mysupermodulefunction) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | A.b = mysupermodulefunction();
17 |
18 | A.v = myModule.x();
19 |
20 | /**
21 | *
22 | * @param oParam
23 | * @param oEvent
24 | */
25 | A.x = function (oParam, oEvent) {
26 | var x = mysupermodulefunction("superparam");
27 | x();
28 | };
29 |
30 | return A;
31 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/variableReuse.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["m/mymod","x/y/z"],
7 | function(myModule, mysupermodulefunction) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | A.b = mysupermodulefunction();
17 |
18 | A.v = myModule.x();
19 |
20 | /**
21 | *
22 | * @param oParam
23 | * @param oEvent
24 | */
25 | A.x = function (oParam, oEvent) {
26 | var x = myModule.doit("superparam");
27 | x();
28 | };
29 |
30 | return A;
31 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/zIndex.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery", /* jQuery Plugin "zIndex"*/
7 | "sap/ui/dom/jquery/zIndex"],
8 | function(jQuery) {
9 | "use strict";
10 |
11 | /**
12 | *
13 | * @type {{}}
14 | */
15 | var A = {};
16 |
17 | /**
18 | *
19 | * @param oParam
20 | * @param oEvent
21 | */
22 | A.x = function (oParam, oEvent) {
23 | // jQuery Plugin "zIndex"
24 | var x = jQuery(oEvent).zIndex();
25 | x();
26 | };
27 |
28 | return A;
29 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/zIndex.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param oEvent
20 | */
21 | A.x = function (oParam, oEvent) {
22 | var x = jQuery(oEvent).zIndex();
23 | x();
24 | };
25 |
26 | return A;
27 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/zIndexNoReplacement.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param oEvent
20 | */
21 | A.x = function (oParam, oEvent) {
22 | var x = oEvent.zIndex();
23 | x();
24 | };
25 |
26 | return A;
27 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addMissingDependencies/zIndexNoReplacement.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param oEvent
20 | */
21 | A.x = function (oParam, oEvent) {
22 | var x = oEvent.zIndex();
23 | x();
24 | };
25 |
26 | return A;
27 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/addRenderers/invalidDefine.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("gs.fin.definestatutoryreportss1.model.Download");
2 | sap.ui.define([
3 | "gs/fin/definestatutoryreportss1/controller/BaseController",
4 | "sap/ui/model/json/JSONModel"
5 | ],
6 | gs.fin.definestatutoryreportss1.model.Download = {
7 |
8 | });
--------------------------------------------------------------------------------
/test/addRenderers/myTestControlNoRendererRenderer.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // Provides renderer for test.MyTestControl.
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | return null;
11 | }, /* bExport= */ true);
12 |
--------------------------------------------------------------------------------
/test/amdCleanup/ComponentReturnModule.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/generic/app/AppComponent"], function(AppComponent) {
2 | "use strict";
3 | sap.ui.getCore().loadLibrary("sap.ui.generic.app");
4 |
5 | var component = AppComponent.extend("mine.Component", {
6 | metadata: {
7 | "manifest": "json"
8 | }
9 | });
10 |
11 | return component;
12 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/ComponentReturnModule.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("mine.Component");
2 | sap.ui.getCore().loadLibrary("sap.ui.generic.app");
3 | jQuery.sap.require("sap.ui.generic.app.AppComponent");
4 |
5 | sap.ui.generic.app.AppComponent.extend("mine.Component", {
6 | metadata: {
7 | "manifest": "json"
8 | }
9 | });
--------------------------------------------------------------------------------
/test/amdCleanup/ComponentReturnModuleAdv.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/generic/app/AppComponent"], function(AppComponent) {
2 | "use strict";
3 | sap.ui.getCore().loadLibrary("sap.ui.generic.app");
4 |
5 | var component = AppComponent.extend("mine.Component", {
6 | metadata: {
7 | "manifest": "json"
8 | }
9 | });
10 |
11 | component.prototype.init = function() {
12 |
13 | };
14 | return component;
15 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/ComponentReturnModuleAdv.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("mine.Component");
2 | sap.ui.getCore().loadLibrary("sap.ui.generic.app");
3 | jQuery.sap.require("sap.ui.generic.app.AppComponent");
4 |
5 | sap.ui.generic.app.AppComponent.extend("mine.Component", {
6 | metadata: {
7 | "manifest": "json"
8 | }
9 | });
10 |
11 | mine.Component.prototype.init = function() {
12 |
13 | };
--------------------------------------------------------------------------------
/test/amdCleanup/ModelReturnModule.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(
2 | ["sap/m/MessageBox", "sap/ui/model/json/JSONModel"],
3 | function(MessageBox, JSONModel) {
4 | "use strict";
5 |
6 | var applicationModel = JSONModel.extend("ui.s2p.slc.questionnre.resp.s1.model.ApplicationModel", {
7 | // app code ...
8 | });
9 |
10 | return applicationModel;
11 | },
12 | true
13 | );
--------------------------------------------------------------------------------
/test/amdCleanup/ModelReturnModule.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.require("sap.m.MessageBox");
2 |
3 | sap.ui.model.json.JSONModel.extend("ui.s2p.slc.questionnre.resp.s1.model.ApplicationModel", {
4 | // app code ...
5 | });
--------------------------------------------------------------------------------
/test/amdCleanup/ModelReturnModuleAdv.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(
2 | ["sap/m/MessageBox", "sap/ui/model/json/JSONModel"],
3 | function(MessageBox, JSONModel) {
4 | "use strict";
5 |
6 | var applicationModel = JSONModel.extend("ui.s2p.slc.questionnre.resp.s1.model.ApplicationModel", {
7 | // app code ...
8 | });
9 |
10 | jQuery.extend(applicationModel.prototype, ui.s2p.slc.questionnre.resp.s1.mixins.MessageMixin);
11 | jQuery.extend(applicationModel.prototype, ui.s2p.slc.questionnre.resp.s1.mixins.ValidationMixin);
12 | return applicationModel;
13 | },
14 | true
15 | );
--------------------------------------------------------------------------------
/test/amdCleanup/ModelReturnModuleAdv.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.require("sap.m.MessageBox");
2 |
3 | sap.ui.model.json.JSONModel.extend("ui.s2p.slc.questionnre.resp.s1.model.ApplicationModel", {
4 | // app code ...
5 | });
6 |
7 | jQuery.extend(ui.s2p.slc.questionnre.resp.s1.model.ApplicationModel.prototype, ui.s2p.slc.questionnre.resp.s1.mixins.MessageMixin);
8 | jQuery.extend(ui.s2p.slc.questionnre.resp.s1.model.ApplicationModel.prototype, ui.s2p.slc.questionnre.resp.s1.mixins.ValidationMixin);
--------------------------------------------------------------------------------
/test/amdCleanup/ModelReturnModuleFormat.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/m/MessageBox", "sap/ui/model/json/JSONModel"], function(MessageBox, JSONModel) {
2 | "use strict";
3 |
4 | var applicationModel = JSONModel.extend("ui.s2p.slc.questionnre.resp.s1.model.ApplicationModel", {
5 | // app code ...
6 | });
7 |
8 | return applicationModel;
9 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/ModelReturnModuleFormat.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.require("sap.m.MessageBox");
2 |
3 | sap.ui.model.json.JSONModel.extend("ui.s2p.slc.questionnre.resp.s1.model.ApplicationModel", {
4 | // app code ...
5 | });
--------------------------------------------------------------------------------
/test/amdCleanup/addComments.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/core/Component"], function(Component) {
2 | "use strict";
3 | var x = {};
4 | x.prototype.a = function() {
5 |
6 | var o = /*TODO review import and replacement*/
7 | Component.getOwnerComponentFor(this._oRouter._oOwner)();
8 | o();
9 | };
10 |
11 | return x;
12 | });
--------------------------------------------------------------------------------
/test/amdCleanup/addComments.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function(){
2 | "use strict";
3 | var x = {};
4 | x.prototype.a = function() {
5 |
6 | var o = sap.ui.core.Component.getOwnerComponentFor(this._oRouter._oOwner)();
7 | o();
8 | };
9 |
10 | return x;
11 | });
--------------------------------------------------------------------------------
/test/amdCleanup/comments.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | "use strict";
3 |
4 | /**
5 | *
6 | * @param sVar variable
7 | * @constructor
8 | */
9 | var component = function(sVar) {
10 | this.sVar = sVar;
11 | };
12 |
13 | return component;
14 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/comments.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("sap.m.sample.TimePicker.Component");
2 |
3 | /**
4 | *
5 | * @param sVar variable
6 | * @constructor
7 | */
8 | sap.m.sample.TimePicker.Component = function(sVar) {
9 | this.sVar = sVar;
10 | };
--------------------------------------------------------------------------------
/test/amdCleanup/dashedImports.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "gs/fin/definestatutoryreportss1/controller/BaseController",
3 | "sap/ui/comp/valuehelpdialog/ValueHelpDialog",
4 | "sap/ui/thirdparty/jqueryui/jquery-ui-core"
5 | ], function(BaseController, ValueHelpDialog, jqueryUiCore) {
6 | "use strict";
7 | return BaseController.extend("gs.fin.definestatutoryreportss1.controller.CorrespondenceMapping");
8 | });
--------------------------------------------------------------------------------
/test/amdCleanup/dashedImports.js:
--------------------------------------------------------------------------------
1 | $.sap.require("sap.ui.thirdparty.jqueryui.jquery-ui-core");
2 |
3 | sap.ui.define([
4 | "gs/fin/definestatutoryreportss1/controller/BaseController",
5 | "sap/ui/comp/valuehelpdialog/ValueHelpDialog"
6 | ], function (BaseController,
7 | ValueHelpDialog) {
8 | "use strict";
9 | return BaseController.extend("gs.fin.definestatutoryreportss1.controller.CorrespondenceMapping");
10 | });
--------------------------------------------------------------------------------
/test/amdCleanup/dashedImportsSimple.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "gs/fin/definestatutoryreportss1/controller/BaseController",
3 | "sap/ui/thirdparty/jqueryui/jquery-ui-core"
4 | ], function(BaseController, jqueryUiCore) {
5 | "use strict";
6 | return BaseController.extend("gs.fin.definestatutoryreportss1.controller.CorrespondenceMapping");
7 | });
--------------------------------------------------------------------------------
/test/amdCleanup/dashedImportsSimple.js:
--------------------------------------------------------------------------------
1 | $.sap.require("sap.ui.thirdparty.jqueryui.jquery-ui-core");
2 |
3 | sap.ui.define([
4 | "gs/fin/definestatutoryreportss1/controller/BaseController"
5 | ], function (BaseController) {
6 | "use strict";
7 | return BaseController.extend("gs.fin.definestatutoryreportss1.controller.CorrespondenceMapping");
8 | });
--------------------------------------------------------------------------------
/test/amdCleanup/dateType.api.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0",
3 | "version": "1.60.0",
4 | "library": "sap.ui.core",
5 | "symbols": [
6 | {
7 | "kind": "class",
8 | "name": "sap.ui.model.type.Date",
9 | "basename": "Date",
10 | "resource": "sap/ui/model/type/Date.js",
11 | "module": "sap/ui/model/type/Date",
12 | "export": "",
13 | "static": true,
14 | "visibility": "public",
15 | "extends": "sap.ui.model.SimpleType",
16 | "description": "This class represents date simple types.",
17 | "ui5-metadata": {
18 | "stereotype": "object"
19 | },
20 | "constructor": {
21 | "visibility": "public"
22 | }
23 | }
24 |
25 | ]
26 | }
--------------------------------------------------------------------------------
/test/amdCleanup/dateType.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "jquery.sap.global",
3 | "sap/ui/core/UIComponent",
4 | "sap/ui/base/Object",
5 | "sap/m/MessageBox",
6 | "sap/ui/model/type/Date"
7 | ],
8 | function(jQuery, UIComponent, UI5Object, MessageBox, TypeDate) {
9 | "use strict";
10 |
11 | var oSuccessHandler = UI5Object.extend("mine.controller.SuccessHandler", {
12 | constructor: function (oComponent) {
13 | }
14 | });
15 |
16 | oSuccessHandler.prototype.successMessagePopover = function(oComponent) {
17 | var oDate = new TypeDate();
18 | return oDate;
19 |
20 | };
21 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/dateType.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["jquery.sap.global", "sap/ui/core/UIComponent", "sap/ui/base/Object", "sap/m/MessageBox"],
2 | function (jQuery, UIComponent, UI5Object, MessageBox) {
3 | "use strict";
4 |
5 | var oSuccessHandler = UI5Object.extend("mine.controller.SuccessHandler", {
6 | constructor: function (oComponent) {
7 | }
8 | });
9 |
10 | oSuccessHandler.prototype.successMessagePopover = function(oComponent) {
11 | var oDate = new sap.ui.model.type.Date();
12 | return oDate;
13 |
14 | };
15 | }, true);
16 |
--------------------------------------------------------------------------------
/test/amdCleanup/declare.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/core/Component"], function(Component) {
2 | "use strict";
3 |
4 | var component = Component.extend("esap.m.sample.TimePicker.Component", {
5 |
6 | metadata : {
7 | rootView : {
8 | "viewName": "esap.m.sample.TimePicker.TimePicker",
9 | "type": "XML",
10 | "async": true
11 | },
12 | dependencies : {
13 | libs : [
14 | "sap.m"
15 | ]
16 | },
17 | config : {
18 | sample : {
19 | files : [
20 | "TimePicker.view.xml",
21 | "TimePicker.controller.js"
22 | ]
23 | }
24 | }
25 | }
26 | });
27 |
28 | return component;
29 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/declare.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("esap.m.sample.TimePicker.Component");
2 |
3 | sap.ui.core.Component.extend("esap.m.sample.TimePicker.Component", {
4 |
5 | metadata : {
6 | rootView : {
7 | "viewName": "esap.m.sample.TimePicker.TimePicker",
8 | "type": "XML",
9 | "async": true
10 | },
11 | dependencies : {
12 | libs : [
13 | "sap.m"
14 | ]
15 | },
16 | config : {
17 | sample : {
18 | files : [
19 | "TimePicker.view.xml",
20 | "TimePicker.controller.js"
21 | ]
22 | }
23 | }
24 | }
25 | });
26 |
--------------------------------------------------------------------------------
/test/amdCleanup/declare2.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 | // esap.mu.i.core.Component
5 | /*
6 | This class contains annotation helpers that might be used from several templates or controls
7 | */
8 | sap.ui.define(["sap/ui/base/ManagedObject"], function(ManagedObject) {
9 | "use strict";
10 |
11 | var component = {
12 |
13 | };
14 |
15 | component.getLineItemPresentation.requiresIContext = true;
16 | component.getChartPresentation.requiresIContext = true;
17 | component.getNavigationCollection.requiresIContext = true;
18 | component.foo = function() {
19 | /*TODO review import and replacement*/
20 | ManagedObject.getNavigationCollection();
21 | };
22 | component.foo();
23 | return component;
24 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/declare2.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 | // esap.mu.i.core.Component
5 | (function () {
6 | "use strict";
7 | /*
8 | This class contains annotation helpers that might be used from several templates or controls
9 | */
10 | jQuery.sap.declare("esap.mu.i.core.Component");
11 | esap.mu.i.core.Component = {
12 |
13 | };
14 | esap.mu.i.core.Component.getLineItemPresentation.requiresIContext = true;
15 | esap.mu.i.core.Component.getChartPresentation.requiresIContext = true;
16 | esap.mu.i.core.Component.getNavigationCollection.requiresIContext = true;
17 | esap.mu.i.core.Component.foo = function() {
18 | sap.ui.base.ManagedObject.getNavigationCollection();
19 | };
20 | esap.mu.i.core.Component.foo();
21 | })();
--------------------------------------------------------------------------------
/test/amdCleanup/declareAndRequire.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "sap/ui/core/Core",
3 | "sap/ui/core/Component",
4 | "sap/ui/core/EnabledPropagator"
5 | ], function(Core, Component, EnabledPropagator) {
6 | "use strict";
7 |
8 | var component = Component.extend("sap.m.sample.TimePicker.Component", {
9 |
10 | metadata : {
11 | rootView : {
12 | "viewName": "sap.m.sample.TimePicker.TimePicker",
13 | "type": "XML",
14 | "async": true
15 | },
16 | dependencies : {
17 | libs : [
18 | "sap.m"
19 | ]
20 | },
21 | config : {
22 | sample : {
23 | files : [
24 | "TimePicker.view.xml",
25 | "TimePicker.controller.js"
26 | ]
27 | }
28 | }
29 | }
30 | });
31 |
32 | return component;
33 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/declareAndRequire.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("sap.m.sample.TimePicker.Component");
2 | jQuery.sap.require("sap.ui.core.Core");
3 |
4 | sap.ui.core.Component.extend("sap.m.sample.TimePicker.Component", {
5 |
6 | metadata : {
7 | rootView : {
8 | "viewName": "sap.m.sample.TimePicker.TimePicker",
9 | "type": "XML",
10 | "async": true
11 | },
12 | dependencies : {
13 | libs : [
14 | "sap.m"
15 | ]
16 | },
17 | config : {
18 | sample : {
19 | files : [
20 | "TimePicker.view.xml",
21 | "TimePicker.controller.js"
22 | ]
23 | }
24 | }
25 | }
26 | });
27 |
28 | jQuery.sap.require("sap.ui.core.EnabledPropagator");
29 |
--------------------------------------------------------------------------------
/test/amdCleanup/declareWithExplicitGlobalReference.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/m/Button"], function(Button) {
2 | "use strict";
3 |
4 | var component = {
5 | x: 47
6 | };
7 |
8 |
9 | component.prototype.x = function() {
10 | return 47;
11 | };
12 |
13 | component.x = 47;
14 | return component;
15 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/declareWithExplicitGlobalReference.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.require("sap/m/Button");
2 | jQuery.sap.declare("sap.m.sample.TimePicker.Component");
3 |
4 | self.sap.m.sample.TimePicker.Component = {
5 | x: 47
6 | };
7 |
8 |
9 | self.sap.m.sample.TimePicker.Component.prototype.x = function() {
10 | return 47;
11 | };
12 |
13 | self.sap.m.sample.TimePicker.Component.x = 47;
--------------------------------------------------------------------------------
/test/amdCleanup/duplicateExportVar.api.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0",
3 | "version": "1.60.0",
4 | "library": "sap.ui.core",
5 | "symbols": [
6 | {
7 | "kind": "class",
8 | "name": "sap.ui.model.json.JSONModel",
9 | "basename": "JSONModel",
10 | "resource": "sap/ui/model/json/JSONModel.js",
11 | "module": "sap/ui/model/json/JSONModel",
12 | "export": "",
13 | "static": true,
14 | "visibility": "public",
15 | "extends": "sap.ui.model.ClientModel",
16 | "description": "Model implementation for JSON format",
17 | "ui5-metadata": {
18 | "stereotype": "object"
19 | },
20 | "constructor": {
21 | "visibility": "public"
22 | }
23 | }
24 |
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/test/amdCleanup/duplicateExportVar.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["jquery.sap.global", "sap/m/Dialog", "sap/ui/model/json/JSONModel"], function(jQuery, Dialog, JSONModel) {
2 | "use strict";
3 |
4 | return Dialog.extend("hpa.cei.cpg.cnt.msg.control.dialog.ApplicationError", {
5 | title: function() {
6 | return new JSONModel("ddd");
7 | }
8 | });
9 |
10 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/duplicateExportVar.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["jquery.sap.global", "sap/m/Dialog"], function(jQuery, Dialog) {
2 | "use strict";
3 |
4 | return Dialog.extend("hpa.cei.cpg.cnt.msg.control.dialog.ApplicationError", {
5 | title: function() {
6 | return new sap.ui.model.json.JSONModel("ddd");
7 | }
8 | });
9 |
10 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/duplicateImports.api.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0",
3 | "version": "1.60.0",
4 | "library": "sap.ui.core",
5 | "symbols": [
6 | {
7 | "kind": "class",
8 | "name": "sap.ui.model.json.JSONModel",
9 | "basename": "JSONModel",
10 | "resource": "sap/ui/model/json/JSONModel.js",
11 | "module": "sap/ui/model/json/JSONModel",
12 | "export": "",
13 | "static": true,
14 | "visibility": "public",
15 | "extends": "sap.ui.model.ClientModel",
16 | "description": "Model implementation for JSON format",
17 | "ui5-metadata": {
18 | "stereotype": "object"
19 | },
20 | "constructor": {
21 | "visibility": "public"
22 | }
23 | }
24 |
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/test/amdCleanup/duplicateImports.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["hpa/cei/mktplan/gantt/settings", "sap/ui/model/json/JSONModel"], function(oGanttSettings, JSONModel) {
2 |
3 | return {
4 | _createGanttChartControl: function() {
5 | if (this._oGroupConfig.aGroupBy.length === 0) {
6 |
7 | return new JSONModel({
8 | id: "ganttView",
9 | baseRowHeight: oGanttSettings
10 | });
11 | }
12 | return null;
13 | }
14 | };
15 | });
--------------------------------------------------------------------------------
/test/amdCleanup/duplicateImports.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "hpa/cei/mktplan/gantt/settings",
3 | "my/unused/dependency",
4 | "hpa/cei/mktplan/gantt/settings"
5 | ], function (ganttSettings, dependency, oGanttSettings) {
6 |
7 | return {
8 | _createGanttChartControl: function() {
9 | if (this._oGroupConfig.aGroupBy.length === 0) {
10 |
11 | return new sap.ui.model.json.JSONModel({
12 | id: "ganttView",
13 | baseRowHeight: oGanttSettings
14 | });
15 | }
16 | return null;
17 | }
18 | };
19 | });
20 |
--------------------------------------------------------------------------------
/test/amdCleanup/duplicateVar.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["mynamespace/s1/controller/BaseController",
2 | "mynamespace/s1/utils/DataRequestManager",
3 | "mynamespace/s1/utils/DataRequestManager"],
4 | function(BaseController, DataRequestManager, oDataRequestManager) {
5 | return BaseController.extend("mynamespace.s1.controller.AnalyticsObjectList", {
6 |
7 | _getHeaderCount : function() {
8 | var oODataModel = this.getOwnerComponent().getModel();
9 | var fSuccessHandler = jQuery.proxy(this._setKPICount, this);
10 | var fErrorHandler = jQuery.proxy(function(errorResponse) {
11 | errorResponse();
12 | }, this);
13 | DataRequestManager.fetchAvailableKPICount(oODataModel, fSuccessHandler, fErrorHandler);
14 | }
15 | });
16 | });
--------------------------------------------------------------------------------
/test/amdCleanup/duplicateVar.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["mynamespace/s1/controller/BaseController",
2 | "mynamespace/s1/utils/DataRequestManager",
3 | "mynamespace/s1/utils/DataRequestManager"],
4 | function(BaseController, DataRequestManager, oDataRequestManager) {
5 | return BaseController.extend("mynamespace.s1.controller.AnalyticsObjectList", {
6 |
7 | _getHeaderCount : function() {
8 | var oODataModel = this.getOwnerComponent().getModel();
9 | var fSuccessHandler = jQuery.proxy(this._setKPICount, this);
10 | var fErrorHandler = jQuery.proxy(function(errorResponse) {
11 | errorResponse();
12 | }, this);
13 | DataRequestManager.fetchAvailableKPICount(oODataModel, fSuccessHandler, fErrorHandler);
14 | }
15 | });
16 | });
--------------------------------------------------------------------------------
/test/amdCleanup/emptyDefine.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | sap.ui.define(function () {
6 | "use strict";
7 |
8 |
9 | });
--------------------------------------------------------------------------------
/test/amdCleanup/emptyDefine.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | sap.ui.define(function () {
6 | "use strict";
7 |
8 |
9 | });
--------------------------------------------------------------------------------
/test/amdCleanup/emptyDefineWithContent.api.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0",
3 | "version": "1.60.0",
4 | "library": "sap.ui.core",
5 | "symbols": [
6 | {
7 | "kind": "class",
8 | "name": "sap.ui.model.json.JSONModel",
9 | "basename": "JSONModel",
10 | "resource": "sap/ui/model/json/JSONModel.js",
11 | "module": "sap/ui/model/json/JSONModel",
12 | "export": "",
13 | "static": true,
14 | "visibility": "public",
15 | "extends": "sap.ui.model.ClientModel",
16 | "description": "Model implementation for JSON format",
17 | "ui5-metadata": {
18 | "stereotype": "object"
19 | },
20 | "constructor": {
21 | "visibility": "public"
22 | }
23 | }
24 |
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/test/amdCleanup/emptyDefineWithContent.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | sap.ui.define(["sap/ui/model/json/JSONModel"], function(JSONModel) {
6 | "use strict";
7 |
8 | return new JSONModel({
9 | id: "keta",
10 | baseRowHeight: 47
11 | });
12 | });
--------------------------------------------------------------------------------
/test/amdCleanup/emptyDefineWithContent.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | sap.ui.define(function () {
6 | "use strict";
7 |
8 | return new sap.ui.model.json.JSONModel({
9 | id: "keta",
10 | baseRowHeight: 47
11 | });
12 | });
--------------------------------------------------------------------------------
/test/amdCleanup/emptyFile.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | "use strict";
3 | });
--------------------------------------------------------------------------------
/test/amdCleanup/emptyFile.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP/ui5-migration/36ba9b5b49907ad330dbe99dd67e80c743434172/test/amdCleanup/emptyFile.js
--------------------------------------------------------------------------------
/test/amdCleanup/excludes.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["jquery.sap.global", "sap/ui/base/ManagedObject"], function(jQuery, ManagedObject) {
2 | "use strict";
3 | //Some code
4 | var bHasChanges = true;
5 | if (sap.ushell) {
6 | sap.ushell.Container.setDirtyFlag(bHasChanges);
7 | }
8 |
9 | if(sap.ui.require) {
10 | sap.ui.require("sap/ui/core/format/NumberFormat");
11 | }
12 |
13 | if (sap.ui.loader) {
14 | sap.ui.loader.config({ noConflict: true });
15 | }
16 |
17 | return ManagedObject.extend("super.module", {
18 | x: jQuery("#x47")
19 | });
20 |
21 | });
--------------------------------------------------------------------------------
/test/amdCleanup/excludes.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "jquery.sap.global"
3 | ], function(jQuery) {
4 | "use strict";
5 | //Some code
6 | var bHasChanges = true;
7 | if (sap.ushell) {
8 | sap.ushell.Container.setDirtyFlag(bHasChanges);
9 | }
10 |
11 | if(sap.ui.require) {
12 | sap.ui.require("sap/ui/core/format/NumberFormat");
13 | }
14 |
15 | if (sap.ui.loader) {
16 | sap.ui.loader.config({ noConflict: true });
17 | }
18 |
19 | return sap.ui.base.ManagedObject.extend("super.module", {
20 | x: jQuery("#x47")
21 | });
22 |
23 | });
--------------------------------------------------------------------------------
/test/amdCleanup/existingImport.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/core/Component"], function(Component){
2 | var o = Component.getOwnerComponentFor(this._oRouter._oOwner)();
3 | o();
4 | });
--------------------------------------------------------------------------------
/test/amdCleanup/existingImport.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/core/Component"], function(Component){
2 | var o = sap.ui.core.Component.getOwnerComponentFor(this._oRouter._oOwner)();
3 | o();
4 | });
--------------------------------------------------------------------------------
/test/amdCleanup/existingVariables.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "my/module"
3 | ], function(module) {
4 | "use strict";
5 |
6 | var applicationContext = {
7 | _planPath: module()
8 | // some additional code here
9 | };
10 |
11 | var coreApplicationContext = applicationContext;
12 | return applicationContext;
13 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/existingVariables.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "my/module"
3 | ], function(module) {
4 | "use strict";
5 |
6 | jQuery.sap.declare("hpa.cei.amp.plan.core.ApplicationContext");
7 |
8 | var applicationContext = {
9 | _planPath: module()
10 | // some additional code here
11 | };
12 |
13 | hpa.cei.amp.plan.core.ApplicationContext = applicationContext;
14 | return applicationContext;
15 |
16 | });
--------------------------------------------------------------------------------
/test/amdCleanup/functionOnly.expected.js:
--------------------------------------------------------------------------------
1 | (sap.ui.define(["sap/ui/core/Component"], function(Component) {
2 | "use strict";
3 |
4 | var x = {};
5 | x.prototype.a = function() {
6 |
7 | var o = /*TODO review import and replacement*/
8 | Component.getOwnerComponentFor(this._oRouter._oOwner)();
9 | o();
10 | };
11 |
12 | return x;
13 | }));
--------------------------------------------------------------------------------
/test/amdCleanup/functionOnly.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 | var x = {};
4 | x.prototype.a = function() {
5 |
6 | var o = sap.ui.core.Component.getOwnerComponentFor(this._oRouter._oOwner)();
7 | o();
8 | };
9 |
10 | return x;
11 | }());
12 |
13 |
--------------------------------------------------------------------------------
/test/amdCleanup/genericApp.api.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0",
3 | "version": "1.61.2",
4 | "library": "sap.ui.generic.app",
5 | "symbols": [
6 | {
7 | "kind": "namespace",
8 | "name": "sap.ui.generic.app",
9 | "basename": "app",
10 | "resource": "sap/ui/generic/app/library.js",
11 | "module": "sap/ui/generic/app/library",
12 | "export": "",
13 | "static": true,
14 | "visibility": "public",
15 | "description": "SAPUI5 library that provides generic reuse functionality which can be used by Applications."
16 | }
17 | ]
18 | }
--------------------------------------------------------------------------------
/test/amdCleanup/genericApp.resources.json:
--------------------------------------------------------------------------------
1 | {
2 | "_version": "1.1.0",
3 | "resources": [
4 | {
5 | "name": ".library"
6 | },
7 | {
8 | "name": "AppComponent-dbg.js",
9 | "module": "sap/ui/generic/app/AppComponent.js",
10 | "isDebug": true,
11 | "required": [
12 | "sap/suite/ui/generic/template/lib/AppComponent.js"
13 | ]
14 | },
15 | {
16 | "name": "AppComponent.js",
17 | "module": "sap/ui/generic/app/AppComponent.js",
18 | "required": [
19 | "sap/suite/ui/generic/template/lib/AppComponent.js"
20 | ]
21 | }
22 | ]
23 | }
--------------------------------------------------------------------------------
/test/amdCleanup/iife.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/m/Button"], function(Button) {
2 | "use strict";
3 |
4 | var navigationMixin = {
5 | process: function(s) {
6 | return s + "x";
7 | }
8 | };
9 |
10 | return navigationMixin;
11 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/iife.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("ns.NavigationMixin");
2 | jQuery.sap.require("sap.m.Button");
3 |
4 | (function() {
5 | "use strict";
6 |
7 | ns.NavigationMixin = {
8 | process: function(s) {
9 | return s + "x";
10 | }
11 | };
12 | }());
--------------------------------------------------------------------------------
/test/amdCleanup/iifeWrapper.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | "use strict";
3 | $("body").fadeIn();
4 | });
--------------------------------------------------------------------------------
/test/amdCleanup/iifeWrapper.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | $("body").fadeIn();
3 | })();
--------------------------------------------------------------------------------
/test/amdCleanup/invalidDefine.expected.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("gs.fin.definestatutoryreportss1.model.Download");
2 | sap.ui.define([
3 | "gs/fin/definestatutoryreportss1/controller/BaseController",
4 | "sap/ui/model/json/JSONModel"
5 | ],
6 | gs.fin.definestatutoryreportss1.model.Download = {
7 |
8 | });
--------------------------------------------------------------------------------
/test/amdCleanup/invalidDefine.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("gs.fin.definestatutoryreportss1.model.Download");
2 | sap.ui.define([
3 | "gs/fin/definestatutoryreportss1/controller/BaseController",
4 | "sap/ui/model/json/JSONModel"
5 | ],
6 | gs.fin.definestatutoryreportss1.model.Download = {
7 |
8 | });
--------------------------------------------------------------------------------
/test/amdCleanup/jsdocDeclare.expected.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | /**
3 | * @deprecated
4 | * Note: You can use it.
5 | * Supports shapes based on SAP UI5 icons.
6 | * Date: 07/04/15
7 | */
8 |
9 | sap.ui.define([], function() {
10 | "use strict";
11 |
12 | namespace("myfn", function(nsLocal) {
13 | "use strict";
14 |
15 | return 47;
16 | });
17 | /* eslint-enable */
18 | });
--------------------------------------------------------------------------------
/test/amdCleanup/jsdocDeclare.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | /**
3 | * @deprecated
4 | * Note: You can use it.
5 | * Supports shapes based on SAP UI5 icons.
6 | * Date: 07/04/15
7 | */
8 |
9 | jQuery.sap.declare("myfn");
10 |
11 | namespace("myfn", function(nsLocal) {
12 | "use strict";
13 |
14 | return 47;
15 | });
16 | /* eslint-enable */
--------------------------------------------------------------------------------
/test/amdCleanup/keepDependency.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "sap/hpa/gseg/cust/controller/BaseController",
3 | "sap/ui/model/Filter",
4 | "sap/ui/model/FilterOperator",
5 | "sap/hpa/gseg/lib/types/PositiveInteger",
6 | "sap/hpa/gseg/cust/types/IntToBool"
7 | ], function (BaseController, Filter, FilterOperator) {
8 | var controller = BaseController.extend("my.base.controller", {});
9 | return controller;
10 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/keepDependency.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "sap/hpa/gseg/cust/controller/BaseController",
3 | "sap/ui/model/Filter",
4 | "sap/ui/model/FilterOperator",
5 | "sap/hpa/gseg/lib/types/PositiveInteger",
6 | "sap/hpa/gseg/cust/types/IntToBool"
7 | ], function (BaseController, Filter, FilterOperator) {
8 | BaseController.extend("my.base.controller", {});
9 | });
--------------------------------------------------------------------------------
/test/amdCleanup/memberExpression.expected.js:
--------------------------------------------------------------------------------
1 | // will make sure sap.ushell.Container exists
2 | sap.ui.define([
3 | "hpa/cei/amp/plan/core/RouterHelper"
4 | ], function(routerHelper) {
5 | "use strict";
6 |
7 | QUnit.module("RouterHelper", {
8 |
9 | beforeEach: function() {
10 | // since it is a "sap" module it will not enforce the namespace to be created at that point
11 | if (!sap.mu.shell.Container.getService) {
12 | sap.mu.shell.Container.getService = function() {}; //eslint-disable-line sap-ui5-no-private-prop
13 | }
14 | routerHelper();
15 | }
16 |
17 | });
18 |
19 | });
--------------------------------------------------------------------------------
/test/amdCleanup/memberExpression.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "hpa/cei/amp/plan/core/RouterHelper"
3 | ], function(routerHelper) {
4 | "use strict";
5 |
6 | QUnit.module("RouterHelper", {
7 |
8 | beforeEach: function() {
9 | jQuery.sap.declare("sap.mu.shell.Container.getService"); // will make sure sap.ushell.Container exists
10 | // since it is a "sap" module it will not enforce the namespace to be created at that point
11 | if (!sap.mu.shell.Container.getService) {
12 | sap.mu.shell.Container.getService = function() {}; //eslint-disable-line sap-ui5-no-private-prop
13 | }
14 | routerHelper();
15 | }
16 |
17 | });
18 |
19 | });
--------------------------------------------------------------------------------
/test/amdCleanup/memberExpressionTop.expected.js:
--------------------------------------------------------------------------------
1 | // since it is a "sap" module it will not enforce the namespace to be created at that point
2 | // will make sure sap.ushell.Container exists
3 | sap.ui.define([
4 | "hpa/cei/amp/plan/core/RouterHelper"
5 | ], function(routerHelper) {
6 | "use strict";
7 |
8 | var getService = function() {}; //eslint-disable-line sap-ui5-no-private-prop
9 | QUnit.module("RouterHelper", {
10 |
11 | beforeEach: function() {
12 | routerHelper();
13 | }
14 |
15 | });
16 |
17 | return getService;
18 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/memberExpressionTop.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "hpa/cei/amp/plan/core/RouterHelper"
3 | ], function(routerHelper) {
4 | "use strict";
5 |
6 | // since it is a "sap" module it will not enforce the namespace to be created at that point
7 | jQuery.sap.declare("sap.mu.shell.Container.getService"); // will make sure sap.ushell.Container exists
8 | sap.mu.shell.Container.getService = function() {}; //eslint-disable-line sap-ui5-no-private-prop
9 | QUnit.module("RouterHelper", {
10 |
11 | beforeEach: function() {
12 | routerHelper();
13 | }
14 |
15 | });
16 |
17 | });
--------------------------------------------------------------------------------
/test/amdCleanup/modelFilter.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/model/Filter"], function(Filter) {
2 | "use strict";
3 | var x = {};
4 | x.prototype.a = function() {
5 |
6 | var oFilter,
7 | sQuery = oEvent.getSource().getValue();
8 | if (sQuery && sQuery.length > 0) {
9 | oFilter = new Filter("Name", sap.ui.model.FilterOperator.Contains, sQuery);
10 | this.getRolesList().getBinding("items").filter([oFilter]);
11 | } else {
12 | this.getRolesList().getBinding("items").filter([]);
13 | }
14 | };
15 |
16 | return x;
17 | });
--------------------------------------------------------------------------------
/test/amdCleanup/modelFilter.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function(){
2 | "use strict";
3 | var x = {};
4 | x.prototype.a = function() {
5 |
6 | var oFilter,
7 | sQuery = oEvent.getSource().getValue();
8 | if (sQuery && sQuery.length > 0) {
9 | oFilter = new sap.ui.model.Filter("Name", sap.ui.model.FilterOperator.Contains, sQuery);
10 | this.getRolesList().getBinding("items").filter([oFilter]);
11 | } else {
12 | this.getRolesList().getBinding("items").filter([]);
13 | }
14 | };
15 |
16 | return x;
17 | });
--------------------------------------------------------------------------------
/test/amdCleanup/objectPath.expected.js:
--------------------------------------------------------------------------------
1 | /*global hpa: false, jQuery: false*/
2 | // hpa.cei.customerjourneyinsight.s4.core.Const
3 | sap.ui.define(["sap/base/util/ObjectPath"], function(ObjectPath) {
4 | "use strict";
5 |
6 | // create namespace
7 | ObjectPath.create("hpa.cei.customerjourneyinsight.s4.core");
8 |
9 | /**
10 | * Constants used for uri parameters
11 | */
12 | hpa.cei.customerjourneyinsight.s4.core.uriParamConst = {
13 | sapUshellConfig: "sap-ushell-config",
14 | headerLess: "headerless"
15 | };
16 | });
--------------------------------------------------------------------------------
/test/amdCleanup/objectPath.js:
--------------------------------------------------------------------------------
1 | /*global hpa: false, jQuery: false*/
2 | // hpa.cei.customerjourneyinsight.s4.core.Const
3 | jQuery.sap.declare("hpa.cei.customerjourneyinsight.s4.core.Const");
4 | /**
5 | * Constants used for uri parameters
6 | */
7 | hpa.cei.customerjourneyinsight.s4.core.uriParamConst = {
8 | sapUshellConfig: "sap-ushell-config",
9 | headerLess: "headerless"
10 | };
--------------------------------------------------------------------------------
/test/amdCleanup/plainModuleName.api.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0",
3 | "version": "1.60.0",
4 | "library": "sap.ui.core",
5 | "symbols": [
6 | {
7 | "kind": "class",
8 | "name": "my.Module",
9 | "basename": "JSONModel",
10 | "resource": "myModule.js",
11 | "module": "myModule",
12 | "export": "",
13 | "static": true,
14 | "visibility": "public",
15 | "extends": "sap.ui.model.ClientModel",
16 | "description": "Model implementation for JSON format",
17 | "ui5-metadata": {
18 | "stereotype": "object"
19 | },
20 | "constructor": {
21 | "visibility": "public"
22 | }
23 | }
24 |
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/test/amdCleanup/plainModuleName.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "jquery.sap.global",
3 | "sap/ui/core/UIComponent",
4 | "sap/ui/base/Object",
5 | "sap/m/MessageBox",
6 | "myModule"
7 | ], function(jQuery, UIComponent, UI5Object, MessageBox, myModule) {
8 | "use strict";
9 |
10 | var oSuccessHandler = UI5Object.extend("mine.controller.SuccessHandler", {
11 | constructor: function (oComponent) {
12 | }
13 | });
14 |
15 | oSuccessHandler.prototype.successMessagePopover = function(oComponent) {
16 | var errorModel = new my.Module();
17 | errorModel.setJSON(oComponent);
18 |
19 | };
20 |
21 | return oSuccessHandler;
22 |
23 | });
--------------------------------------------------------------------------------
/test/amdCleanup/plainModuleName.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["jquery.sap.global", "sap/ui/core/UIComponent", "sap/ui/base/Object", "sap/m/MessageBox"],
2 | function (jQuery, UIComponent, UI5Object, MessageBox) {
3 | "use strict";
4 |
5 | var oSuccessHandler = UI5Object.extend("mine.controller.SuccessHandler", {
6 | constructor: function (oComponent) {
7 | }
8 | });
9 |
10 | oSuccessHandler.prototype.successMessagePopover = function(oComponent) {
11 | var errorModel = new my.Module();
12 | errorModel.setJSON(oComponent);
13 |
14 | };
15 |
16 | return oSuccessHandler;
17 |
18 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/property.api.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0",
3 | "version": "1.60.0",
4 | "library": "sap.ui.core",
5 | "symbols": [
6 | {
7 | "kind": "class",
8 | "name": "sap.ui.model.json.JSONModel",
9 | "basename": "JSONModel",
10 | "resource": "sap/ui/model/json/JSONModel.js",
11 | "module": "sap/ui/model/json/JSONModel",
12 | "export": "",
13 | "static": true,
14 | "visibility": "public",
15 | "extends": "sap.ui.model.ClientModel",
16 | "description": "Model implementation for JSON format",
17 | "ui5-metadata": {
18 | "stereotype": "object"
19 | },
20 | "constructor": {
21 | "visibility": "public"
22 | }
23 | }
24 |
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/test/amdCleanup/property.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "hpa/cei/mktplan/gantt/settings",
3 | "sap/ui/model/json/JSONModel"
4 | ], function (oGanttSettings, JSONModel) {
5 |
6 | return {
7 | _createGanttChartControl: function() {
8 | if (this._oGroupConfig.aGroupBy.length === 0) {
9 |
10 | return new JSONModel({
11 | id: "ganttView",
12 | baseRowHeight: oGanttSettings
13 | });
14 | }
15 | return null;
16 | }
17 | };
18 | });
--------------------------------------------------------------------------------
/test/amdCleanup/property.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "hpa/cei/mktplan/gantt/settings",
3 | "my/unused/dependency"
4 | ], function (oGanttSettings, dependency) {
5 |
6 | return {
7 | _createGanttChartControl: function() {
8 | if (this._oGroupConfig.aGroupBy.length === 0) {
9 |
10 | return new sap.ui.model.json.JSONModel({
11 | id: "ganttView",
12 | baseRowHeight: oGanttSettings
13 | });
14 | }
15 | return null;
16 | }
17 | };
18 | });
19 |
--------------------------------------------------------------------------------
/test/amdCleanup/relative.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | /**
6 | * Initialization Code and shared classes of library sap.ui.core.
7 | */
8 | sap.ui.define(['sap/ui/base/DataType', './CalendarType', './library', './Core'],
9 | function(DataType, CalendarType, library) {
10 | "use strict";
11 |
12 | // shortcut for sap.ui.core.AbsoluteCSSSize
13 | var AbsoluteCSSSize = library.AbsoluteCSSSize;
14 |
15 | var test = AbsoluteCSSSize.Select;
16 |
17 | return test(DataType.String) + CalendarType.Gregorian;
18 | });
--------------------------------------------------------------------------------
/test/amdCleanup/relative.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | /**
6 | * Initialization Code and shared classes of library sap.ui.core.
7 | */
8 | sap.ui.define(['sap/ui/base/DataType', './CalendarType', './library', './Core'],
9 | function(DataType, CalendarType, library) {
10 | "use strict";
11 |
12 | var test = sap.ui.core.AbsoluteCSSSize.Select;
13 |
14 | return test(DataType.String) + CalendarType.Gregorian;
15 |
16 | });
17 |
--------------------------------------------------------------------------------
/test/amdCleanup/require.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/core/Component"], function(Component) {
2 | "use strict";
3 | (function(Component) {
4 | var x = new Component("x");
5 | return x;
6 | }(Component));
7 | });
--------------------------------------------------------------------------------
/test/amdCleanup/require.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.require("sap.ui.core.Component");
2 | (function(Component) {
3 | var x = new Component("x");
4 | return x;
5 | }(sap.ui.core.Component));
--------------------------------------------------------------------------------
/test/amdCleanup/reservedKeywords.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | "use strict";
3 |
4 | var timePickerConst = {
5 | x: 47
6 | };
7 |
8 | return timePickerConst;
9 | }, true);
--------------------------------------------------------------------------------
/test/amdCleanup/reservedKeywords.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("sap.m.sample.TimePicker.const");
2 |
3 | sap.m.sample.TimePicker.const = {
4 | x: 47
5 | };
6 |
--------------------------------------------------------------------------------
/test/amdCleanup/singleStatement.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/core/Component"], function(Component) {
2 | var o = Component.getOwnerComponentFor(this._oRouter._oOwner)();
3 | o();
4 | });
--------------------------------------------------------------------------------
/test/amdCleanup/singleStatement.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function(){
2 | var o = sap.ui.core.Component.getOwnerComponentFor(this._oRouter._oOwner)();
3 | o();
4 | });
--------------------------------------------------------------------------------
/test/amdCleanup/twoStatements.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/core/Component"], function(Component) {
2 | var o = Component.getOwnerComponentFor(this._oRouter._oOwner)();
3 | o = o || Component.getOwnerComponentFor(this._oRouter._oOwner)();
4 | o();
5 | });
--------------------------------------------------------------------------------
/test/amdCleanup/twoStatements.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function(){
2 | var o = sap.ui.core.Component.getOwnerComponentFor(this._oRouter._oOwner)();
3 | o = o || sap.ui.core.Component.getOwnerComponentFor(this._oRouter._oOwner)();
4 | o();
5 | });
--------------------------------------------------------------------------------
/test/amdCleanup/varvar.api.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0",
3 | "version": "1.60.0",
4 | "library": "sap.ui.core",
5 | "symbols": [
6 | {
7 | "kind": "class",
8 | "name": "sap.ui.model.json.JSONModel",
9 | "basename": "JSONModel",
10 | "resource": "sap/ui/model/json/JSONModel.js",
11 | "module": "sap/ui/model/json/JSONModel",
12 | "export": "",
13 | "static": true,
14 | "visibility": "public",
15 | "extends": "sap.ui.model.ClientModel",
16 | "description": "Model implementation for JSON format",
17 | "ui5-metadata": {
18 | "stereotype": "object"
19 | },
20 | "constructor": {
21 | "visibility": "public"
22 | }
23 | }
24 |
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/test/amdCleanup/varvar.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "jquery.sap.global",
3 | "sap/ui/core/UIComponent",
4 | "sap/ui/base/Object",
5 | "sap/m/MessageBox",
6 | "sap/ui/model/json/JSONModel"
7 | ], function(jQuery, UIComponent, UI5Object, MessageBox, JSONModel) {
8 | "use strict";
9 |
10 | var oSuccessHandler = UI5Object.extend("mine.controller.SuccessHandler", {
11 | constructor: function (oComponent) {
12 | }
13 | });
14 |
15 | oSuccessHandler.prototype.successMessagePopover = function(oComponent) {
16 | var errorModel = new JSONModel();
17 | errorModel.setJSON(oComponent);
18 |
19 | };
20 |
21 | return oSuccessHandler;
22 |
23 | });
--------------------------------------------------------------------------------
/test/amdCleanup/varvar.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["jquery.sap.global", "sap/ui/core/UIComponent", "sap/ui/base/Object", "sap/m/MessageBox"],
2 | function (jQuery, UIComponent, UI5Object, MessageBox) {
3 | "use strict";
4 |
5 | var oSuccessHandler = UI5Object.extend("mine.controller.SuccessHandler", {
6 | constructor: function (oComponent) {
7 | }
8 | });
9 |
10 | oSuccessHandler.prototype.successMessagePopover = function(oComponent) {
11 | var errorModel = new sap.ui.model.json.JSONModel();
12 | errorModel.setJSON(oComponent);
13 |
14 | };
15 |
16 | return oSuccessHandler;
17 |
18 | }, true);
--------------------------------------------------------------------------------
/test/fixTypeDependency/_core.resources.json:
--------------------------------------------------------------------------------
1 | {
2 | "_version": "1.1.0",
3 | "resources": [
4 | {
5 | "name": "library.js",
6 | "module": "sap/ui/core/library.js",
7 | "required": [
8 | "sap/ui/base/DataType.js",
9 | "sap/ui/core/CalendarType.js",
10 | "sap/ui/core/Core.js"
11 | ]
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/test/fixTypeDependency/invalidDefine.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("gs.fin.definestatutoryreportss1.model.Download");
2 | sap.ui.define([
3 | 'sap/ui/table/TreeAutoExpandMode'
4 | ],
5 | gs.fin.definestatutoryreportss1.model.Download = {
6 |
7 | });
--------------------------------------------------------------------------------
/test/fixTypeDependency/library.expected.js:
--------------------------------------------------------------------------------
1 | // Provides class sap.ui.model.odata.ODataTreeBindingAdapter
2 | sap.ui.define(['jquery.sap.global', 'sap/ui/model/TreeBinding', './v2/ODataTreeBinding', 'sap/ui/model/TreeBindingAdapter' ,'sap/ui/model/ChangeReason', 'sap/ui/model/TreeBindingUtils', './OperationMode', "sap/ui/table/library"],
3 | function(jQuery, TreeBinding, ODataTreeBinding, TreeBindingAdapter, ChangeReason, TreeBindingUtils, OperationMode, library) {
4 | "use strict";
5 |
6 | // shortcut for sap.ui.table.TreeAutoExpandMode
7 | var TreeAutoExpandMode = library.TreeAutoExpandMode;
8 |
9 | return TreeAutoExpandMode();
10 | });
--------------------------------------------------------------------------------
/test/fixTypeDependency/library.js:
--------------------------------------------------------------------------------
1 | // Provides class sap.ui.model.odata.ODataTreeBindingAdapter
2 | sap.ui.define(['jquery.sap.global', 'sap/ui/model/TreeBinding', './v2/ODataTreeBinding', 'sap/ui/model/TreeBindingAdapter' ,'sap/ui/table/TreeAutoExpandMode', 'sap/ui/model/ChangeReason', 'sap/ui/model/TreeBindingUtils', './OperationMode'],
3 | function(jQuery, TreeBinding, ODataTreeBinding, TreeBindingAdapter, TreeAutoExpandMode, ChangeReason, TreeBindingUtils, OperationMode) {
4 | "use strict";
5 |
6 | return TreeAutoExpandMode();
7 | });
--------------------------------------------------------------------------------
/test/fixTypeDependency/libraryDependency.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/core/library"], function(coreLibrary) {
2 | "use strict";
3 |
4 | // shortcut for sap.ui.core.ValueState
5 | var ValueState = coreLibrary.ValueState;
6 |
7 | return ValueState;
8 | });
--------------------------------------------------------------------------------
/test/fixTypeDependency/libraryNamespace.js:
--------------------------------------------------------------------------------
1 | // Provides class sap.ui.model.odata.ODataTreeBindingAdapter
2 | sap.ui.define(['jquery.sap.global', 'sap/ui/layout/GridSpan', 'sap/ui/model/TreeBinding', './v2/ODataTreeBinding', 'sap/ui/model/TreeBindingAdapter' ,'sap/ui/table/TreeAutoExpandMode', 'sap/ui/model/ChangeReason', 'sap/ui/model/TreeBindingUtils', './OperationMode'],
3 | function(jQuery, GridSpan, TreeBinding, ODataTreeBinding, TreeBindingAdapter, TreeAutoExpandMode, ChangeReason, TreeBindingUtils, OperationMode) {
4 | "use strict";
5 |
6 | return TreeAutoExpandMode();
7 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/ModuleSystem.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.registerResourcePath": {
5 | "functionName": "sap.ui.loader.config",
6 | "replacer": "ModuleSystem",
7 | "version": "1.58.0"
8 | },
9 | "jQuery.sap.registerModulePath": {
10 | "functionName": "sap.ui.loader.config",
11 | "replacer": "ModuleSystem",
12 | "version": "1.58.0"
13 | }
14 | }
15 | },
16 | "replacers": {
17 | "ModuleSystem": "tasks/helpers/replacers/ModuleSystem.js"
18 | }
19 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/RisBundle.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/i18n/ResourceBundle"],
7 | function(ResourceBundle) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | A.x = oParam.aa instanceof ResourceBundle;
23 | A.f = ResourceBundle.create(oParam.bb);
24 |
25 | if (sContent instanceof ResourceBundle) {
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/RisBundle.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.resources'],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | A.x = jQuery.sap.resources.isBundle(oParam.aa);
23 | A.f = jQuery.sap.resources(oParam.bb);
24 |
25 | if (jQuery.sap.resources.isBundle(sContent)) {
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/addcomment.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.globalEval": {
5 | "replacer": "AddComment",
6 | "commentText": "Remove evil eval"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "AddComment": "tasks/helpers/replacers/AddComment.js"
12 | }
13 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/addcomment.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global'],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | //Remove evil eval
23 | jQuery.sap.globalEval("'; DROP TABLE Users; --");
24 |
25 | //Remove evil eval
26 | if (jQuery.sap.globalEval("cat /etc/passwd") == 3) {
27 | }
28 | };
29 |
30 | return A;
31 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/addcomment.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global'],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | jQuery.sap.globalEval("'; DROP TABLE Users; --");
23 |
24 | if (jQuery.sap.globalEval("cat /etc/passwd") == 3) {
25 | }
26 | };
27 |
28 | return A;
29 | }, /* bExport= */ true);
30 |
--------------------------------------------------------------------------------
/test/replaceGlobals/assign.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.script": {
4 | "jQuery.sap.extend": {
5 | "newModulePath": "sap/base/util/merge",
6 | "newVariableName": "merge",
7 | "replacer": "mergeOrObjectAssign",
8 | "version": "1.58.0"
9 | }
10 | }
11 | },
12 | "replacers": {
13 | "mergeOrObjectAssign": "tasks/helpers/replacers/mergeOrObjectAssign.js"
14 | },
15 | "comments": {
16 | "unhandledReplacementComment": "TODO unhandled replacement"
17 | },
18 | "excludes": []
19 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/assignmodfunc.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.func": {
5 | "newModulePath": "do/not/import"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js"
11 | }
12 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/assignmodfunc.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | jQuery.sap.func = function() {
17 | console.log("evil implementation");
18 | };
19 |
20 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/assignmodfunc.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | jQuery.sap.func = function() {
17 | console.log("evil implementation");
18 | };
19 |
20 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/asterisk.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.resources": {
4 | "jQuery.sap.resources.*": {
5 | "newModulePath": "sap/base/i18n/ResourceBundle"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js"
11 | },
12 | "excludes": []
13 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/asterisk.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/i18n/ResourceBundle", "jquery.sap.encoder"],
7 | function(ResourceBundle) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (ResourceBundle.isBundle(iconInfo.resourceBundle)) {
23 | var sKey = "Test." + iconName;
24 | if (iconInfo.resourceBundle.hasText(sKey)) {
25 | var sText = iconInfo.resourceBundle.getText(sKey);
26 | }
27 | }
28 | };
29 |
30 | return A;
31 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/asterisk.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.encoder"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.sap.resources.isBundle(iconInfo.resourceBundle)) {
23 | var sKey = "Test." + iconName;
24 | if (iconInfo.resourceBundle.hasText(sKey)) {
25 | var sText = iconInfo.resourceBundle.getText(sKey);
26 | }
27 | }
28 | };
29 |
30 | return A;
31 | }, /* bExport= */ true);
32 |
--------------------------------------------------------------------------------
/test/replaceGlobals/comments.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.unhandled": {
5 | "replacer": "LEAVE"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "LEAVE": "tasks/helpers/replacers/LEAVE.js"
11 | },
12 | "comments": {
13 | "failedReplacementComment": " Hallo, I bims eins Kommentar"
14 | }
15 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/delay.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.script": {
4 | "jQuery.sap.delayedCall": {
5 | "replacer": "DelayedCall"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "DelayedCall": "tasks/helpers/replacers/DelayedCall.js"
11 | },
12 | "excludes": []
13 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/domById.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.dom": {
4 | "jQuery.sap.domById": {
5 | "replacer": "domById"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "domById": "tasks/helpers/replacers/domById.js"
11 | },
12 | "excludes": []
13 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/domFocus.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.focus": {
5 | "replacer": "domFocus"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "domFocus": "tasks/helpers/replacers/domFocus.js"
11 | }
12 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/domFocus.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.global"],
7 | function() {
8 | "use strict";
9 |
10 | // simple
11 |
12 | var a = abc ? abc.focus() || true : undefined;
13 |
14 | if (a) {
15 | a.focus();
16 | }
17 |
18 | if (b ? b.focus() || true : undefined) { }
19 |
20 | // complex
21 |
22 | var bFocused = undefined;
23 |
24 | bFocused = undefined;
25 |
26 | if (a[b + 3]) {
27 | a[b + 3].focus();
28 | }
29 |
30 | if (hello()) {
31 | hello().focus();
32 | }
33 |
34 | // not supported
35 |
36 | var d = jQuery.sap.focus.bind(a);
37 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/domFocus.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.global"],
7 | function() {
8 | "use strict";
9 |
10 | // simple
11 |
12 | var a = jQuery.sap.focus(abc);
13 |
14 | jQuery.sap.focus(a);
15 |
16 | if (jQuery.sap.focus(b)) { }
17 |
18 | // complex
19 |
20 | var bFocused = jQuery.sap.focus();
21 |
22 | bFocused = jQuery.sap.focus();
23 |
24 | jQuery.sap.focus(a[b + 3]);
25 |
26 | jQuery.sap.focus(hello());
27 |
28 | // not supported
29 |
30 | var d = jQuery.sap.focus.bind(a);
31 | });
32 |
--------------------------------------------------------------------------------
/test/replaceGlobals/duplication.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.require": {
5 | "newModulePath": "LEAVE",
6 | "replacer": "LEAVE"
7 | },
8 | "jQuery.sap.log.Level": {
9 | "newModulePath": "sap/base/log",
10 | "newVariableName": "Log",
11 | "functionName": "Level"
12 | }
13 | },
14 | "GLOBALS": {
15 | "jQuery": {
16 | "newModulePath": "sap/ui/thirdparty/jquery",
17 | "newVariableName": "jQuery"
18 | }
19 | }
20 | },
21 | "replacers": {
22 | "LEAVE": "tasks/helpers/replacers/LEAVE.js",
23 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
24 | "Module": "tasks/helpers/replacers/Module.js"
25 | }
26 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/duplication.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global', "sap/base/log", "sap/ui/thirdparty/jquery"],
7 | function(jQuery, Log, jQuery0) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | jQuery.sap.require("my.test.module");
23 |
24 | if (jQuery0("#test") == Log.Level.ERROR) {
25 | }
26 | };
27 |
28 | return A;
29 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/duplication.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | jQuery.sap.require("my.test.module");
23 |
24 | if (jQuery("#test") == jQuery.sap.log.Level.ERROR) {
25 | }
26 | };
27 |
28 | return A;
29 | }, /* bExport= */ true);
30 |
--------------------------------------------------------------------------------
/test/replaceGlobals/each.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery.each": {
5 | "newModulePath": "sap/base/util/each"
6 | }
7 | },
8 | "jquery.sap.script": {
9 | "jQuery.sap.each": {
10 | "newModulePath": "sap/base/util/each"
11 | }
12 | }
13 | },
14 | "replacers": {
15 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
16 | "Module": "tasks/helpers/replacers/Module.js"
17 | },
18 | "excludes": []
19 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/each.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/util/each"],
7 | function(each) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (oParam.iTest === 47) {
23 | each(oParam.mMap, function(i, value) {
24 | value.doIt(1);
25 | });
26 | }
27 |
28 |
29 | each([1,2,3], function(i, value) {
30 | value.doIt(2);
31 | });
32 |
33 |
34 | each(oParam.mMap, function(i, value) {
35 | value.doIt(3);
36 | });
37 | };
38 |
39 | return A;
40 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/each.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.script"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (oParam.iTest === 47) {
23 | jQuery.each(oParam.mMap, function(i, value) {
24 | value.doIt(1);
25 | });
26 | }
27 |
28 |
29 | jQuery.sap.each([1,2,3], function(i, value) {
30 | value.doIt(2);
31 | });
32 |
33 |
34 | jQuery.each(oParam.mMap, function(i, value) {
35 | value.doIt(3);
36 | });
37 | };
38 |
39 | return A;
40 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/endsWith.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.strings": {
4 | "jQuery.sap.endsWith": {
5 | "functionName": "endsWith",
6 | "replacer": "NativeStringFunction",
7 | "version": "1.58.0"
8 | },
9 | "jQuery.sap.startsWith": {
10 | "functionName": "startsWith",
11 | "replacer": "NativeStringFunction",
12 | "version": "1.58.0"
13 | }
14 | }
15 | },
16 | "replacers": {
17 | "NativeStringFunction": "tasks/helpers/replacers/NativeStringFunction.js"
18 | },
19 | "excludes": []
20 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/endsWithIgnoreCase.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.strings": {
4 | "$.endsWithIgnoreCase": {
5 | "replacer": "startsOrEndsWithIgnoreCase",
6 | "startsOrEndsWithFunction": "endsWith"
7 | },
8 | "jQuery.sap.endsWithIgnoreCase": {
9 | "replacer": "startsOrEndsWithIgnoreCase",
10 | "startsOrEndsWithFunction": "endsWith"
11 | }
12 | }
13 | },
14 | "replacers": {
15 | "startsOrEndsWithIgnoreCase": "tasks/helpers/replacers/startsOrEndsWithIgnoreCase.js"
16 | }
17 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/extend.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.script": {
4 | "jQuery.sap.extend": {
5 | "newModulePath": "sap/base/util/merge",
6 | "newVariableName": "merge",
7 | "replacer": "mergeOrObjectAssign",
8 | "version": "1.58.0"
9 | }
10 | }
11 | },
12 | "replacers": {
13 | "mergeOrObjectAssign": "tasks/helpers/replacers/mergeOrObjectAssign.js"
14 | },
15 | "comments": {
16 | "unhandledReplacementComment": "TODO unhandled replacement"
17 | },
18 | "excludes": []
19 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/extend.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/util/merge"],
7 | function(merge) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName + oParam.control;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).control(merge(sKey, sContent));
27 | }
28 | var x$ = merge(sKey, sContent);
29 | x$.control();
30 | }
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/extend.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName + oParam.control;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).control(jQuery.sap.extend(true, sKey, sContent));
27 | }
28 | var x$ = jQuery.sap.extend(true, sKey, sContent);
29 | x$.control();
30 | }
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/extendAndAssign.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.script": {
4 | "jQuery.sap.extend": {
5 | "newModulePath": "sap/base/util/merge",
6 | "newVariableName": "merge",
7 | "replacer": "mergeOrObjectAssign",
8 | "version": "1.58.0"
9 | }
10 | }
11 | },
12 | "replacers": {
13 | "mergeOrObjectAssign": "tasks/helpers/replacers/mergeOrObjectAssign.js"
14 | },
15 | "comments": {
16 | "unhandledReplacementComment": "TODO unhandled replacement"
17 | },
18 | "excludes": []
19 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/extendImport.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery.extend": {
5 | "newModulePath": "sap/ui/thirdparty/jquery",
6 | "newVariableName": "jQuery",
7 | "functionName": "extend",
8 | "replacer": "jQueryExtend",
9 | "version": "^1.58.0"
10 | }
11 | }
12 | },
13 | "replacers": {
14 | "jQueryExtend": "tasks/helpers/replacers/jQueryExtend.js"
15 | },
16 | "comments": {
17 | "unhandledReplacementComment": "TODO unhandled replacement"
18 | },
19 | "excludes": []
20 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/extendImport.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/thirdparty/jquery"], function(jQuery0) {
2 | this.oDataInitialBkp = jQuery0.extend(true, [], this.oJSONModel);
3 | this.oDataInitial = jQuery0.extend(true, {}, this.getData());
4 | return {};
5 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/extendImport.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | this.oDataInitialBkp = jQuery.extend(true, [], this.oJSONModel);
3 | this.oDataInitial = jQuery.extend(true, {}, this.getData());
4 | return {};
5 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/gennoop.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "$.noop": {
5 | "replacer": "GenNOOP"
6 | },
7 | "jQuery.noop": {
8 | "replacer": "GenNOOP"
9 | }
10 | }
11 | },
12 | "replacers": {
13 | "GenNOOP": "tasks/helpers/replacers/GenNOOP.js"
14 | }
15 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/gennoop.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | var a = function() {};
11 |
12 | var b = {
13 | a: function() {}
14 | };
15 |
16 | var c = (true ? function() {} : a)();
17 | })
--------------------------------------------------------------------------------
/test/replaceGlobals/gennoop.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global'],
7 | function($) {
8 | "use strict";
9 |
10 | var a = $.noop;
11 |
12 | var b = {
13 | a: $.noop
14 | };
15 |
16 | var c = (true ? $.noop : a)();
17 | })
--------------------------------------------------------------------------------
/test/replaceGlobals/getObject.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.getObject": {
5 | "newModulePath": "sap/base/util/ObjectPath",
6 | "replacer": "GetObject"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "GetObject": "tasks/helpers/replacers/GetObject.js"
12 | },
13 | "excludes": []
14 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/getter.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.getter": {
5 | "replacer": "Getter"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "Getter": "tasks/helpers/replacers/Getter.js"
11 | }
12 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/getter.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | A.x = function(value) {
17 | return function() {
18 | return value;
19 | };
20 | }(new Item({}));
21 |
22 | A.y = function(value) {
23 | return function() {
24 | return value;
25 | };
26 | }(false);
27 |
28 | A.z = function(value) {
29 | return function() {
30 | return value;
31 | };
32 | }(A.x);
33 |
34 | A.xxx = function(value) {
35 | return function() {
36 | return value;
37 | };
38 | }(this.x);
39 |
40 | return A;
41 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/getter.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global'],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | A.x = jQuery.sap.getter(new Item({}));
17 |
18 | A.y = jQuery.sap.getter(false);
19 |
20 | A.z = jQuery.sap.getter(A.x);
21 |
22 | A.xxx = jQuery.sap.getter(this.x);
23 |
24 | return A;
25 | }, /* bExport= */ true);
26 |
--------------------------------------------------------------------------------
/test/replaceGlobals/inArray.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "GLOBALS": {
4 | "jQuery.inArray": {
5 | "replacer": "inArray"
6 | },
7 | "$.inArray": {
8 | "replacer": "inArray"
9 | }
10 | }
11 | },
12 | "replacers": {
13 | "inArray": "tasks/helpers/replacers/inArray.js"
14 | },
15 | "excludes": []
16 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/inclusive158.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/security/URLWhitelist"],
7 | function(URLWhitelist) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | var b = {};
23 | var x = 5;
24 | this.u = 10;
25 |
26 | URLWhitelist.clear();
27 |
28 | URLWhitelist.delete(URLWhitelist.entries()[oParam]);
29 |
30 | URLWhitelist.add("", "example.com", 1337);
31 |
32 | URLWhitelist.entries();
33 | URLWhitelist.validate(sContent);
34 | };
35 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/inclusive158.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.encoder"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | var b = {};
23 | var x = 5;
24 | this.u = 10;
25 |
26 | jQuery.sap.clearUrlWhitelist();
27 |
28 | jQuery.sap.removeUrlWhitelist(oParam);
29 |
30 | jQuery.sap.addUrlWhitelist("", "example.com", 1337);
31 |
32 | jQuery.sap.getUrlWhitelist();
33 | jQuery.sap.validateUrl(sContent);
34 | };
35 | }, /* bExport= */ true);
36 |
--------------------------------------------------------------------------------
/test/replaceGlobals/inclusive185.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.encoder"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | var b = {};
23 | var x = 5;
24 | this.u = 10;
25 |
26 | jQuery.sap.clearUrlWhitelist();
27 |
28 | jQuery.sap.removeUrlWhitelist(oParam);
29 |
30 | jQuery.sap.addUrlWhitelist("", "example.com", 1337);
31 |
32 | jQuery.sap.getUrlWhitelist();
33 | jQuery.sap.validateUrl(sContent);
34 | };
35 | }, /* bExport= */ true);
36 |
--------------------------------------------------------------------------------
/test/replaceGlobals/inclusive190.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/security/URLWhitelist"],
7 | function(URLWhitelist) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | var b = {};
23 | var x = 5;
24 | this.u = 10;
25 |
26 | URLWhitelist.clear();
27 |
28 | URLWhitelist.delete(URLWhitelist.entries()[oParam]);
29 |
30 | URLWhitelist.add("", "example.com", 1337);
31 |
32 | URLWhitelist.entries();
33 | URLWhitelist.validate(sContent);
34 | };
35 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/intervalCall.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.script": {
4 | "jQuery.sap.intervalCall": {
5 | "replacer": "IntervalCall"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "IntervalCall": "tasks/helpers/replacers/IntervalCall.js"
11 | },
12 | "excludes": []
13 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/invalidDefine.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery.isPlainObject": {
5 | "newModulePath": "sap/base/util/isPlainObject",
6 | "version": "1.58.0"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
12 | "Module": "tasks/helpers/replacers/Module.js"
13 | }
14 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/invalidDefine.expected.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("gs.fin.definestatutoryreportss1.model.Download");
2 | sap.ui.define([
3 | "gs/fin/definestatutoryreportss1/controller/BaseController",
4 | "sap/ui/model/json/JSONModel"
5 | ],
6 | gs.fin.definestatutoryreportss1.model.Download = {
7 | keta: function() {
8 | jQuery.sap.intervalCall(500, b, this.x);
9 | }
10 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/invalidDefine.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.declare("gs.fin.definestatutoryreportss1.model.Download");
2 | sap.ui.define([
3 | "gs/fin/definestatutoryreportss1/controller/BaseController",
4 | "sap/ui/model/json/JSONModel"
5 | ],
6 | gs.fin.definestatutoryreportss1.model.Download = {
7 | keta: function() {
8 | jQuery.sap.intervalCall(500, b, this.x);
9 | }
10 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/isEqualNode.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.xml": {
4 | "jQuery.sap.isEqualNode": {
5 | "functionName": "isEqualNode",
6 | "replacer": "NativeInstanceFunction"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "NativeInstanceFunction": "tasks/helpers/replacers/NativeInstanceFunction.js"
12 | },
13 | "excludes": []
14 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/isMouseEventDelayed.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.events": {
4 | "jQuery.sap.isMouseEventDelayed": {
5 | "newModulePath": "sap/ui/events/isMouseEventDelayed",
6 | "replacer": "isMouseEventDelayed"
7 | },
8 | "$.sap.isMouseEventDelayed": {
9 | "newModulePath": "sap/ui/events/isMouseEventDelayed",
10 | "replacer": "isMouseEventDelayed"
11 | }
12 | }
13 | },
14 | "replacers": {
15 | "isMouseEventDelayed": "tasks/helpers/replacers/isMouseEventDelayed.js"
16 | },
17 | "excludes": []
18 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/isPlainObject.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery.isPlainObject": {
5 | "newModulePath": "sap/base/util/isPlainObject",
6 | "version": "1.58.0"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
12 | "Module": "tasks/helpers/replacers/Module.js"
13 | }
14 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/isPlainObject.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/util/isPlainObject"],
7 | function(isPlainObject) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (isPlainObject(iconInfo.resourceBundle)) {
23 | var sKey = "Test." + iconName;
24 | if (iconInfo.resourceBundle.hasText(sKey)) {
25 | var x = isPlainObject(sContent);
26 | oParam(x);
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/isPlainObject.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.isPlainObject(iconInfo.resourceBundle)) {
23 | var sKey = "Test." + iconName;
24 | if (iconInfo.resourceBundle.hasText(sKey)) {
25 | var x = jQuery.isPlainObject(sContent);
26 | oParam(x);
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
33 |
--------------------------------------------------------------------------------
/test/replaceGlobals/isPlainObject2.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery.isPlainObject": {
5 | "newModulePath": "sap/base/util/isPlainObject",
6 | "version": "1.58.0"
7 | },
8 | "jQuery.each": {
9 | "newModulePath": "sap/ui/thirdparty/jquery",
10 | "newVariableName": "jQuery",
11 | "functionName": "each",
12 | "version": "1.58.0"
13 | }
14 | }
15 | },
16 | "replacers": {
17 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
18 | "Module": "tasks/helpers/replacers/Module.js"
19 | }
20 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jQ.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.assert": {
5 | "newModulePath": "sap/base/assert",
6 | "version": "1.58.9"
7 | }
8 | },
9 | "GLOBALS": {
10 | "jQuery": {
11 | "newModulePath": "thirdparty/jQuery",
12 | "version": "1.58.9"
13 | },
14 | "jQuery.extend": {
15 | "newModulePath": "thirdparty/jQuery",
16 | "functionName": "extend",
17 | "version": "1.58.9"
18 | }
19 | }
20 | },
21 | "replacers": {
22 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
23 | "Module": "tasks/helpers/replacers/Module.js",
24 | "LEAVE": "tasks/helpers/replacers/LEAVE.js"
25 | },
26 | "excludes": []
27 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jQueryContains.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery.contains": {
5 | "replacer": "jQueryContains",
6 | "version": "^1.58.0"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "jQueryContains": "tasks/helpers/replacers/jQueryContains.js"
12 | },
13 | "comments": {
14 | "unhandledReplacementComment": "TODO unhandled replacement"
15 | },
16 | "excludes": []
17 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jQueryContains.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var x = oParam !== sContent && oParam.contains(sContent);
25 | x();
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jQueryContains.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var x = jQuery.contains(oParam, sContent);
25 | x();
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jquery.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap._loadJSResourceAsync": {
5 | "newModulePath": "LEAVE",
6 | "replacer": "LEAVE"
7 | }
8 | },
9 | "GLOBALS": {
10 | "jQuery": {
11 | "newModulePath": "sap/ui/thirdparty/jquery",
12 | "newVariableName": "jQuery"
13 | },
14 | "jQuery.extend": {
15 | "newModulePath": "sap/ui/thirdparty/jquery",
16 | "functionName": "extend",
17 | "newVariableName": "jQuery"
18 | }
19 | }
20 | },
21 | "replacers": {
22 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
23 | "Module": "tasks/helpers/replacers/Module.js"
24 | }
25 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jquery.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery(iconInfo.resourceBundle)) {
23 | var sKey = "Test." + iconName;
24 | if (iconInfo.resourceBundle.hasText(sKey)) {
25 | var x = jQuery.extend({}, sContent);
26 | oParam(x);
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jquery.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery(iconInfo.resourceBundle)) {
23 | var sKey = "Test." + iconName;
24 | if (iconInfo.resourceBundle.hasText(sKey)) {
25 | var x = jQuery.extend({}, sContent);
26 | oParam(x);
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
33 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryDom.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.dom": {
4 | "jQuery.sap.byId": {
5 | "newModulePath": "sap/ui/thirdparty/jquery",
6 | "replacer": "jqueryDomById"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "jqueryDomById": "tasks/helpers/replacers/jqueryDomById.js"
12 | }
13 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryDom.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery"],
7 | function(jquery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | var oMyWindow = null;
23 |
24 | var a = jquery(document.getElementById("abc"));
25 |
26 | var d = "jkl";
27 | var e = jquery(document.getElementById(d));
28 |
29 | var f = jquery(document.getElementById("mno" + d));
30 | };
31 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryDom.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.dom"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | var oMyWindow = null;
23 |
24 | var a = jQuery.sap.byId("abc");
25 |
26 | var d = "jkl";
27 | var e = jQuery.sap.byId(d);
28 |
29 | var f = jQuery.sap.byId("mno" + d);
30 | };
31 | }, /* bExport= */ true);
32 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryExtend.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery.extend": {
5 | "newModulePath": "sap/ui/thirdparty/jquery",
6 | "newVariableName": "jQuery",
7 | "functionName": "extend",
8 | "replacer": "jQueryExtend",
9 | "version": "^1.58.0"
10 | }
11 | }
12 | },
13 | "replacers": {
14 | "jQueryExtend": "tasks/helpers/replacers/jQueryExtend.js"
15 | }
16 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryExtendSkipImport.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery.extend": {
5 | "newModulePath": "sap/ui/thirdparty/jquery",
6 | "newVariableName": "jQuery",
7 | "functionName": "extend",
8 | "replacer": "jQueryExtend"
9 | }
10 | }
11 | },
12 | "replacers": {
13 | "jQueryExtend": "tasks/helpers/replacers/jQueryExtend.js"
14 | }
15 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryExtendSkipImport.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 | Object.assign({}, oParam);
23 | };
24 |
25 | return A;
26 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryExtendSkipImport.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 | jQuery.extend({}, oParam);
23 | };
24 |
25 | return A;
26 | }, /* bExport= */ true);
27 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryExtendVars.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery.extend": {
5 | "newModulePath": "sap/ui/thirdparty/jquery",
6 | "newVariableName": "jQuery",
7 | "functionName": "extend",
8 | "replacer": "jQueryExtend",
9 | "version": "^1.58.0"
10 | }
11 | }
12 | },
13 | "replacers": {
14 | "jQueryExtend": "tasks/helpers/replacers/jQueryExtend.js"
15 | }
16 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryExtendVars.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 | var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation"), // get a handle on the global XAppNav service
23 | oContext = oEvt.context,
24 | oWindow = Object.assign({}, window.location);
25 | };
26 |
27 | return A;
28 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryExtendVars.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['sap/ui/thirdparty/jquery'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 | var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation"), // get a handle on the global XAppNav service
23 | oContext = oEvt.context,
24 | oWindow = jQuery.extend({}, window.location);
25 | };
26 |
27 | return A;
28 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryThirdParty.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap._loadJSResourceAsync": {
5 | "newModulePath": "LEAVE",
6 | "replacer": "LEAVE"
7 | }
8 | },
9 | "sap/ui/thirdparty/jquery": {
10 | "jQuery": {
11 | "newModulePath": "sap/ui/thirdparty/jquery",
12 | "newVariableName": "jQuery"
13 | },
14 | "jQuery.extend": {
15 | "newModulePath": "sap/ui/thirdparty/jquery",
16 | "functionName": "extend",
17 | "newVariableName": "jQuery"
18 | }
19 | }
20 | },
21 | "replacers": {
22 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
23 | "Module": "tasks/helpers/replacers/Module.js"
24 | }
25 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryThirdParty.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/thirdparty/jquery"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery(iconInfo.resourceBundle)) {
23 | var sKey = "Test." + iconName;
24 | if (iconInfo.resourceBundle.hasText(sKey)) {
25 | var x = jQuery.extend({}, sContent);
26 | oParam(x);
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryThirdParty.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery(iconInfo.resourceBundle)) {
23 | var sKey = "Test." + iconName;
24 | if (iconInfo.resourceBundle.hasText(sKey)) {
25 | var x = jQuery.extend({}, sContent);
26 | oParam(x);
27 | }
28 | }
29 | };
30 |
31 | return A;
32 | }, /* bExport= */ true);
33 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryTrim.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery.trim": {
5 | "replacer": "jQueryTrim",
6 | "version": "^1.58.0"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "jQueryTrim": "tasks/helpers/replacers/jQueryTrim.js"
12 | }
13 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryTrim.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 | oParam = typeof oParam === "string" ? oParam.trim() : oParam != null ? String(oParam).trim() : "";
23 | sContent = typeof sContent === "string" ? sContent.trim() : sContent != null ? String(sContent).trim() : "";
24 | oParam(sContent);
25 | };
26 |
27 | return A;
28 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryTrim.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['sap/ui/thirdparty/jquery'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 | oParam = jQuery.trim(oParam);
23 | sContent = jQuery.trim(sContent);
24 | oParam(sContent);
25 | };
26 |
27 | return A;
28 | }, /* bExport= */ true);
29 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jquerydeviceisiphone.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.mobile": {
4 | "jQuery.device.is.iphone": {
5 | "newModulePath": "sap/ui/Device",
6 | "newVariableName": "Device",
7 | "objectProperty": ["os","system"],
8 | "functionNames": ["ios", "phone"],
9 | "replacer": "ModuleFunctionWithObjectProperty",
10 | "conjunctionOperator": "&&"
11 | }
12 | }
13 | },
14 | "replacers": {
15 | "ModuleFunctionWithObjectProperty": "tasks/helpers/replacers/ModuleFunctionWithObjectProperty.js"
16 | }
17 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jquerydeviceisiphone.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/Device"],
7 | function(Device) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (Device.os.ios && Device.system.phone) {
23 | var sKey = "Test." + (Device.os.ios && Device.system.phone)? true : false;
24 | oParam(Device.os.ios && Device.system.phone);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jquerydeviceisiphone.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.device.is.iphone) {
23 | var sKey = "Test." + jQuery.device.is.iphone? true : false;
24 | oParam(jQuery.device.is.iphone);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jquerydeviceisstandalone.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.mobile": {
4 | "jQuery.device.is.standalone": {
5 | "functionName": "window.navigator.standalone",
6 | "replacer": "NativeObject"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "NativeObject": "tasks/helpers/replacers/NativeObject.js"
12 | }
13 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jquerydeviceisstandalone.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (window.navigator.standalone) {
23 | var sKey = "Test." + window.navigator.standalone;
24 | oParam(window.navigator.standalone);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jquerydeviceisstandalone.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.device.is.standalone) {
23 | var sKey = "Test." + jQuery.device.is.standalone;
24 | oParam(jQuery.device.is.standalone);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryos.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.mobile": {
4 | "jQuery.os.os": {
5 | "newModulePath": "sap/ui/Device",
6 | "newVariableName": "Device",
7 | "objectProperty": "os",
8 | "functionName": "name",
9 | "replacer": "ModuleFunctionWithObjectProperty",
10 | "version": "1.58.0"
11 | }
12 | }
13 | },
14 | "replacers": {
15 | "ModuleFunctionWithObjectProperty": "tasks/helpers/replacers/ModuleFunctionWithObjectProperty.js"
16 | }
17 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryos.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/Device"],
7 | function(Device) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (Device.os.name) {
23 | var sKey = "Test." + Device.os.name;
24 | oParam(Device.os.name);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryos.invalid.require.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.mobile": {
4 | "jQuery.os.os": {
5 | "newModulePath": "sap/ui/Device",
6 | "newVariableName": "Device",
7 | "objectProperty": "os",
8 | "functionName": "name",
9 | "replacer": "ModuleFunctionWithObjectProperty",
10 | "version": "1.58.0"
11 | }
12 | }
13 | },
14 | "replacers": {
15 | "ModuleFunctionWithObjectProperty": "tasks/helpers/replacers/ModuleFunctionWithObjectProperty.js"
16 | }
17 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryos.invalid.require.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.require('jquery.sap.mobile');
7 | var a = function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.os.os) {
23 | var sKey = "Test." + jQuery.os.os;
24 | oParam(jQuery.os.os);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | };
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryos.invalid.require.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.require('jquery.sap.mobile');
7 | var a = function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.os.os) {
23 | var sKey = "Test." + jQuery.os.os;
24 | oParam(jQuery.os.os);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | };
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryos.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.mobile'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.os.os) {
23 | var sKey = "Test." + jQuery.os.os;
24 | oParam(jQuery.os.os);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryos.require.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.mobile": {
4 | "jQuery.os.os": {
5 | "newModulePath": "sap/ui/Device",
6 | "newVariableName": "Device",
7 | "objectProperty": "os",
8 | "functionName": "name",
9 | "replacer": "ModuleFunctionWithObjectProperty",
10 | "version": "1.58.0"
11 | }
12 | }
13 | },
14 | "replacers": {
15 | "ModuleFunctionWithObjectProperty": "tasks/helpers/replacers/ModuleFunctionWithObjectProperty.js"
16 | }
17 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryos.require.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.require(["sap/ui/Device"],
7 | function(Device) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (Device.os.name) {
23 | var sKey = "Test." + Device.os.name;
24 | oParam(Device.os.name);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryos.require.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.require(['jquery.sap.mobile'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.os.os) {
23 | var sKey = "Test." + jQuery.os.os;
24 | oParam(jQuery.os.os);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | });
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryosname.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.mobile": {
4 | "jQuery.os.win": {
5 | "newModulePath": "sap/ui/Device",
6 | "newVariableName": "Device",
7 | "objectProperty": "os",
8 | "functionName": "name",
9 | "comparisonValue": "win",
10 | "replacer": "ModuleFunctionWithObjectPropertyComparison"
11 | }
12 | }
13 | },
14 | "replacers": {
15 | "ModuleFunctionWithObjectPropertyComparison": "tasks/helpers/replacers/ModuleFunctionWithObjectPropertyComparison.js"
16 | }
17 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryosname.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/Device"],
7 | function(Device) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (Device.os.name === "win") {
23 | var sKey = "Test." + (Device.os.name === "win");
24 | oParam(Device.os.name === "win");
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/jqueryosname.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.mobile'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.os.win) {
23 | var sKey = "Test." + jQuery.os.win;
24 | oParam(jQuery.os.win);
25 | sContent(sKey);
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/jstokenizer.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.script": {
4 | "jQuery.sap._createJSTokenizer": {
5 | "newModulePath": "sap/base/util/JSTokenizer",
6 | "replacer": "NewInstanceNoArgs"
7 | },
8 | "jQuery.sap.parseJS": {
9 | "newModulePath": "sap/base/util/JSTokenizer",
10 | "functionName": "parseJS"
11 | }
12 | }
13 | },
14 | "replacers": {
15 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
16 | "Module": "tasks/helpers/replacers/Module.js",
17 | "ModuleWithInvocation": "tasks/helpers/replacers/ModuleWithInvocation.js",
18 | "NewInstanceNoArgs": "tasks/helpers/replacers/NewInstanceNoArgs.js"
19 | }
20 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/laterSapDefine.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.log.Level": {
5 | "newModulePath": "sap/base/Log",
6 | "newVariableName": "Log",
7 | "functionName": "Level",
8 | "version": "1.58.0"
9 | },
10 | "jQuery.sap.log.LogLevel": {
11 | "newModulePath": "sap/base/Log",
12 | "newVariableName": "Log",
13 | "functionName": "Level",
14 | "version": "1.58.0"
15 | }
16 | }
17 | },
18 | "replacers": {
19 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
20 | "Module": "tasks/helpers/replacers/Module.js"
21 | }
22 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/leave.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.history": {
4 | "jQuery.sap.history": {
5 | "newModulePath": "LEAVE",
6 | "replacer": "LEAVE",
7 | "version": "^1.58.0",
8 | "errorComment": " TODO: migration not possible. jQuery.sap.history is deprecated. Please use sap.ui.core.routing.Route
"
9 | }
10 | }
11 | },
12 | "replacers": {
13 | "LEAVE": "tasks/helpers/replacers/LEAVE.js"
14 | }
15 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/leave.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.history'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oLogEntry
19 | * @param sContent
20 | */
21 | A.x = function(oLogEntry, sContent) {
22 | if (oLogEntry) {
23 | // TODO: migration not possible. jQuery.sap.history is deprecated. Please use sap.ui.core.routing.Route
24 | if (jQuery.sap.history(sContent)) {
25 | return false;
26 | }
27 | }
28 | };
29 |
30 | return A;
31 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/leave.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.history'],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oLogEntry
19 | * @param sContent
20 | */
21 | A.x = function(oLogEntry, sContent) {
22 | if (oLogEntry) {
23 | if (jQuery.sap.history(sContent)) {
24 | return false;
25 | }
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/loglevel.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.log.Level": {
5 | "newModulePath": "sap/base/Log",
6 | "newVariableName": "Log",
7 | "functionName": "Level",
8 | "version": "1.58.0"
9 | },
10 | "jQuery.sap.log.LogLevel": {
11 | "newModulePath": "sap/base/Log",
12 | "newVariableName": "Log",
13 | "functionName": "Level",
14 | "version": "1.58.0"
15 | }
16 | }
17 | },
18 | "replacers": {
19 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
20 | "Module": "tasks/helpers/replacers/Module.js"
21 | }
22 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/loglevel.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/Log"],
7 | function(Log) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oLogEntry
19 | * @param sContent
20 | */
21 | A.x = function(oLogEntry, sContent) {
22 | if (oLogEntry) {
23 | if (oLogEntry.level != Log.Level.ERROR && oLogEntry.level != Log.Level.FATAL) {
24 | return false;
25 | }
26 |
27 | if (oLogEntry.level == Log.Level.ERROR || oLogEntry.level === Log.Level.FATAL) {
28 | return false;
29 | }
30 | }
31 | sContent(Log.Level.ERROR);
32 | };
33 |
34 | return A;
35 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/measure.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.measure.start": {
5 | "newModulePath": "sap/ui/performance/Measurement",
6 | "functionName": "start"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
12 | "Module": "tasks/helpers/replacers/Module.js"
13 | }
14 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/mock.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.log": {
5 | "newModulePath": "sap/base/Log",
6 | "newVariableName": "Log"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
12 | "Module": "tasks/helpers/replacers/Module.js"
13 | }
14 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/mock.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/Log"],
7 | function(Log) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | sinon.spy(Log, "error");
23 | };
24 |
25 | return A;
26 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/mock.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.global'],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | sinon.spy(jQuery.sap.log, "error");
23 | };
24 |
25 | return A;
26 | }, /* bExport= */ true);
27 |
--------------------------------------------------------------------------------
/test/replaceGlobals/moduleWithInvoc.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.script": {
4 | "jQuery.sap.parseJS": {
5 | "newModulePath": "sap/base/util/JSTokenizer",
6 | "functionName": "parseJS",
7 | "replacer": "ModuleWithInvocation"
8 | }
9 | }
10 | },
11 | "replacers": {
12 | "ModuleWithInvocation": "tasks/helpers/replacers/ModuleWithInvocation.js"
13 | },
14 | "excludes": []
15 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/moduleWithInvoc.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/util/JSTokenizer"],
7 | function(JSTokenizer) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | JSTokenizer().parseJS("foo");
23 |
24 | var a = JSTokenizer().parseJS("bar");
25 |
26 | a = JSTokenizer().parseJS.bind("abc");
27 |
28 | var b = JSTokenizer().parseJS("foo") + JSTokenizer().parseJS("bar");
29 | };
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/moduleWithInvoc.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.script"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | jQuery.sap.parseJS("foo");
23 |
24 | var a = jQuery.sap.parseJS("bar");
25 |
26 | a = jQuery.sap.parseJS.bind("abc");
27 |
28 | var b = jQuery.sap.parseJS("foo") + jQuery.sap.parseJS("bar");
29 | };
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/moduleWithScopedInvoc.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.storage": {
4 | "jQuery.sap.storage": {
5 | "newModulePath": "sap/ui/util/Storage",
6 | "functionName": "getInstance",
7 | "replacer": "ModuleWithWindowScopedInvocation"
8 | }
9 | }
10 | },
11 | "replacers": {
12 | "ModuleWithWindowScopedInvocation": "tasks/helpers/replacers/ModuleWithWindowScopedInvocation.js"
13 | },
14 | "excludes": []
15 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/moduleWithScopedInvoc.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/ui/util/Storage"],
7 | function(Storage) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | Storage(window).getInstance("foo");
23 |
24 | var a = Storage(window).getInstance("bar");
25 |
26 | a = Storage(window).getInstance.bind("abc");
27 |
28 | var b = Storage(window).getInstance + Storage(window).getInstance;
29 | };
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/moduleWithScopedInvoc.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.storage"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | jQuery.sap.storage("foo");
23 |
24 | var a = jQuery.sap.storage("bar");
25 |
26 | a = jQuery.sap.storage.bind("abc");
27 |
28 | var b = jQuery.sap.storage + jQuery.sap.storage;
29 | };
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/nativeFunction.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.eval": {
5 | "replacer": "NativeFunction",
6 | "functionName": "eval"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "NativeFunction": "tasks/helpers/replacers/NativeFunction.js"
12 | },
13 | "excludes": []
14 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/nativeFunction.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | eval("eeeeeevil");
23 |
24 | var a = eval("function() { return \"even more evil\"; }");
25 | };
26 |
27 | return A;
28 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/nativeFunction.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.global"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | jQuery.sap.eval("eeeeeevil");
23 |
24 | var a = jQuery.sap.eval("function() { return \"even more evil\"; }");
25 | };
26 |
27 | return A;
28 | }, /* bExport= */ true);
29 |
--------------------------------------------------------------------------------
/test/replaceGlobals/nativeFunctionArgCheck.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.newObject": {
5 | "replacer": "NativeFunctionWithArgumentCheck",
6 | "newVariableName": "Object",
7 | "functionName": "create"
8 | }
9 | }
10 | },
11 | "replacers": {
12 | "NativeFunctionWithArgumentCheck": "tasks/helpers/replacers/NativeFunctionWithArgumentCheck.js"
13 | },
14 | "excludes": []
15 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/nativeFunctionArgCheck.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | Object.create(sContent || null);
23 |
24 | var a = Object.create({});
25 |
26 | var b = Object.create(oParam.prototype || null);
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/nativeFunctionArgCheck.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.global"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | jQuery.sap.newObject(sContent);
23 |
24 | var a = jQuery.sap.newObject({});
25 |
26 | var b = jQuery.sap.newObject(oParam.prototype);
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/nativeObject.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.isArray": {
5 | "functionName": "Array.isArray",
6 | "replacer": "NativeObject"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "NativeObject": "tasks/helpers/replacers/NativeObject.js"
12 | }
13 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/nativeObject.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.resources'],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | A.x = Array.isArray(oParam.aa);
23 | A.f = A.x || Array.isArray(oParam.bb);
24 |
25 | if (Array.isArray(sContent)) {
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/nativeObject.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['jquery.sap.resources'],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | A.x = jQuery.isArray(oParam.aa);
23 | A.f = A.x || jQuery.isArray(oParam.bb);
24 |
25 | if (jQuery.isArray(sContent)) {
26 | }
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/nonRoot.expected.js:
--------------------------------------------------------------------------------
1 | (function(bli, bla) {
2 | sap.ui.define(["jQuery.sap.global"], function() {
3 | jQuery.sap.encodeXML("");
4 | });
5 |
6 | if (bli) {
7 | sap.ui.define(["jQuery.sap.global"], function() {
8 | jQuery.sap.encodeXML("");
9 | });
10 | }
11 | })(0, 1);
--------------------------------------------------------------------------------
/test/replaceGlobals/nonRoot.js:
--------------------------------------------------------------------------------
1 | (function(bli, bla) {
2 | sap.ui.define(["jQuery.sap.global"], function() {
3 | jQuery.sap.encodeXML("");
4 | });
5 |
6 | if (bli) {
7 | sap.ui.define(["jQuery.sap.global"], function() {
8 | jQuery.sap.encodeXML("");
9 | });
10 | }
11 | })(0, 1);
12 |
--------------------------------------------------------------------------------
/test/replaceGlobals/padding.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.strings": {
4 | "jQuery.sap.padLeft": {
5 | "replacer": "ModuleFunctionPadding",
6 | "functionName": "padStart",
7 | "version": "1.58.0"
8 | }
9 | }
10 | },
11 | "replacers": {
12 | "ModuleFunctionPadding": "tasks/helpers/replacers/ModuleFunctionPadding.js"
13 | },
14 | "excludes": []
15 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/padding.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.encoder"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (oParam.iTest === 47) {
23 | oParam.doIt("background-image", "url('" + sContent.padStart(10, "a") + "')");
24 | }
25 |
26 |
27 | sContent.padStart(110, "b");
28 |
29 | sContent.padStart(110, "0");
30 | "yolo".padStart(110, "0");
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/padding.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.encoder", "jquery.sap.strings"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (oParam.iTest === 47) {
23 | oParam.doIt("background-image", "url('" + jQuery.sap.padLeft(sContent, "a", 10) + "')");
24 | }
25 |
26 |
27 | jQuery.sap.padLeft(sContent, "b", 110);
28 |
29 | jQuery.sap.padLeft(sContent, "0", 110);
30 | jQuery.sap.padLeft("yolo", "0", 110);
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
35 |
--------------------------------------------------------------------------------
/test/replaceGlobals/removeUrlWhitelist.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.encoder": {
4 | "jQuery.sap.removeUrlWhitelist": {
5 | "newModulePath": "sap/base/security/URLWhitelist",
6 | "replacer": "RemoveUrlWhitelist"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "RemoveUrlWhitelist": "tasks/helpers/replacers/RemoveUrlWhitelist.js"
12 | },
13 | "excludes": []
14 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/removeUrlWhitelist.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/security/URLWhitelist"],
7 | function(URLWhitelist) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | var b = {};
23 |
24 | URLWhitelist.delete(URLWhitelist.entries()[200]);
25 |
26 | URLWhitelist.delete(URLWhitelist.entries()[b]);
27 |
28 | URLWhitelist.delete(URLWhitelist.entries()[this.x]);
29 | };
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/removeUrlWhitelist.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.encoder"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | var b = {};
23 |
24 | jQuery.sap.removeUrlWhitelist(200);
25 |
26 | jQuery.sap.removeUrlWhitelist(b);
27 |
28 | jQuery.sap.removeUrlWhitelist(this.x);
29 | };
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/resourceModulePaths.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.getModulePath": {
5 | "functionName": "sap.ui.require.toUrl",
6 | "replacer": "resourceModulePaths",
7 | "version": "1.58.0"
8 | },
9 | "jQuery.sap.getResourcePath": {
10 | "functionName": "sap.ui.require.toUrl",
11 | "replacer": "resourceModulePaths",
12 | "version": "1.58.0"
13 | }
14 | }
15 | },
16 | "replacers": {
17 | "resourceModulePaths": "tasks/helpers/replacers/resourceModulePaths.js"
18 | }
19 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/retina.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.mobile": {
4 | "jQuery.support.retina": {
5 | "replacer": "RetinaSupport"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "RetinaSupport": "tasks/helpers/replacers/RetinaSupport.js"
11 | }
12 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/retina.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (window.devicePixelRatio >= 2) {
23 | }
24 |
25 | var a = window.devicePixelRatio >= 2 ? oParam : sContent;
26 |
27 | a();
28 | };
29 |
30 | return A;
31 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/retina.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.mobile"],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | if (jQuery.support.retina) {
23 | }
24 |
25 | var a = jQuery.support.retina ? oParam : sContent;
26 |
27 | a();
28 | };
29 |
30 | return A;
31 | }, /* bExport= */ true);
32 |
--------------------------------------------------------------------------------
/test/replaceGlobals/reuseVar.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/security/encodeXML"],
7 | function(encodeXML) {
8 | "use strict";
9 |
10 | encodeXML("blablabla");
11 |
12 | encodeXML("bliblablubb");
13 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/reuseVar.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["sap/base/security/encodeXML", "jquery.sap.encoder"],
7 | function(encodeXML) {
8 | "use strict";
9 |
10 | jQuery.sap.encodeXML("blablabla");
11 |
12 | encodeXML("bliblablubb");
13 | });
14 |
--------------------------------------------------------------------------------
/test/replaceGlobals/sapextend.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.script": {
4 | "jQuery.sap.extend": {
5 | "version": "1.58.0"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "mergeOrObjectAssign": "tasks/helpers/replacers/mergeOrObjectAssign.js"
11 | },
12 | "comments": {
13 | "unhandledReplacementComment": "TODO unhandled replacement"
14 | },
15 | "excludes": []
16 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/sapextend.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName + oParam.control;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).control(jQuery.sap.extend(true, sKey, sContent));
27 | }
28 | var x$ = jQuery.sap.extend(true, sKey, sContent);
29 | x$.control();
30 | }
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/sapextend.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define([],
7 | function() {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 |
23 | if (oParam.control(0)) {
24 | var sKey = "Test." + iconName + oParam.control;
25 | if (iconInfo.resourceBundle.hasText(sKey)) {
26 | $(sKey).control(jQuery.sap.extend(true, sKey, sContent));
27 | }
28 | var x$ = jQuery.sap.extend(true, sKey, sContent);
29 | x$.control();
30 | }
31 | };
32 |
33 | return A;
34 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/setObject.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.setObject": {
5 | "newModulePath": "sap/base/util/getObject",
6 | "replacer": "SetObject"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "SetObject": "tasks/helpers/replacers/SetObject.js"
12 | },
13 | "excludes": []
14 | }
15 |
--------------------------------------------------------------------------------
/test/replaceGlobals/startsWithIgnoreCase.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.strings": {
4 | "$.startsWithIgnoreCase": {
5 | "replacer": "startsOrEndsWithIgnoreCase",
6 | "startsOrEndsWithFunction": "startsWith",
7 | "version": "1.58.0"
8 | },
9 | "jQuery.sap.startsWithIgnoreCase": {
10 | "replacer": "startsOrEndsWithIgnoreCase",
11 | "startsOrEndsWithFunction": "startsWith",
12 | "version": "1.58.0"
13 | }
14 | }
15 | },
16 | "replacers": {
17 | "startsOrEndsWithIgnoreCase": "tasks/helpers/replacers/startsOrEndsWithIgnoreCase.js"
18 | }
19 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/storage.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(['sap/ui/util/Storage'],
7 | function (Storage) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function (oParam, sContent) {
22 | Storage.Type.local;
23 | Storage.put("test", { lorem: "ipsum" });
24 | new Storage(Storage.Type.local).remove("test");
25 |
26 | Storage.Type.local;
27 | Storage.put("test", { lorem: "ipsum" });
28 | new Storage(Storage.Type.local).remove("test");
29 | sContent(Storage.Type.local);
30 | };
31 |
32 | return A;
33 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/testSpies.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.log": {
5 | "newModulePath": "sap/base/Log",
6 | "version": "^1.58.0"
7 | },
8 | "jQuery.sap.log.debug": {
9 | "newModulePath": "sap/base/Log",
10 | "functionName": "debug",
11 | "version": "^1.58.0"
12 | }
13 | }
14 | },
15 | "replacers": {
16 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
17 | "Module": "tasks/helpers/replacers/Module.js"
18 | }
19 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/unset_global.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "a": {
4 | "a.fnct": {
5 | "newModulePath": "newA"
6 | }
7 | },
8 | "b": {
9 | "b.fnct": {
10 | "newModulePath": "newB"
11 | }
12 | },
13 | "GLOBALS": {
14 | "jQuery": {
15 | "newModulePath": "sap/ui/thirdparty/jquery",
16 | "newVariableName": "jQuery"
17 | }
18 | }
19 | },
20 | "replacers": {
21 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
22 | "Module": "tasks/helpers/replacers/Module.js"
23 | }
24 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/unset_global.expected.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["newA", "newB", "sap/ui/thirdparty/jquery", "c"],
7 | function(newA, newB, jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | newA("abc");
23 | newB("def");
24 | c_fnct("ghi");
25 |
26 | jQuery("bla");
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/unset_global.js:
--------------------------------------------------------------------------------
1 | /* !
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["a", "b", "c", "sap/ui/thirdparty/jquery"],
7 | function(a, b /*, c, jQuery */) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function(oParam, sContent) {
22 | a.fnct("abc");
23 | b.fnct("def");
24 | c_fnct("ghi");
25 |
26 | jQuery("bla");
27 | };
28 |
29 | return A;
30 | }, /* bExport= */ true);
31 |
--------------------------------------------------------------------------------
/test/replaceGlobals/unusedGlobals.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.mod1": {
4 |
5 | },
6 | "jquery.sap.mod3": {
7 |
8 | }
9 | },
10 | "replacers": {
11 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js"
12 | },
13 | "excludes": []
14 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/uriParams.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.script": {
4 | "jQuery.sap.getUriParameters": {
5 | "functionName": "fromURL",
6 | "newModulePath": "sap/base/util/UriParameters",
7 | "newVariableName": "UriParameters",
8 | "replacer": "UriParameters",
9 | "functionParameter": "window.location.href",
10 | "version": "^1.68.0"
11 | }
12 | }
13 | },
14 | "replacers": {
15 | "UriParameters": "tasks/helpers/replacers/UriParameters.js"
16 | },
17 | "excludes": []
18 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/variableAssignment.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.log": {
5 | "newModulePath": "sap/base/Log",
6 | "version": "^1.58.0"
7 | }
8 | }
9 | },
10 | "replacers": {
11 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
12 | "Module": "tasks/helpers/replacers/Module.js"
13 | },
14 | "comments": {
15 | "unhandledReplacementComment": "TODO unhandled replacement"
16 | },
17 | "excludes": []
18 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/variableAssignment.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["myns/fragment/FragmentDialog", "sap/base/Log"], function(FragmentDialog, Log) {
2 | "use strict";
3 |
4 | var CreateEntityDialog = FragmentDialog.extend("CONST.namespace" + ".control.dialog.CreateEntityDialog", {
5 | _log: Log
6 | });
7 | return CreateEntityDialog;
8 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/variableAssignment.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([
2 | "myns/fragment/FragmentDialog"
3 | ], function (FragmentDialog) {
4 | "use strict";
5 |
6 | var CreateEntityDialog = FragmentDialog.extend("CONST.namespace" + ".control.dialog.CreateEntityDialog", {
7 | _log: jQuery.sap.log
8 | });
9 | return CreateEntityDialog;
10 | });
--------------------------------------------------------------------------------
/test/replaceGlobals/version.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "jquery.sap.global": {
4 | "jQuery.sap.Version": {
5 | "newModulePath": "sap/base/Version"
6 | }
7 | }
8 | },
9 | "replacers": {
10 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
11 | "Module": "tasks/helpers/replacers/Module.js"
12 | }
13 | }
--------------------------------------------------------------------------------
/test/replaceGlobals/versionReplacement.expected.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.script"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function () {
22 | Object.assign({}, {}, {});
23 | jQuery.sap.uid();
24 | };
25 |
26 | return A;
27 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/replaceGlobals/versionReplacement.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * ${copyright}
3 | */
4 |
5 | // A module
6 | sap.ui.define(["jquery.sap.script"],
7 | function(jQuery) {
8 | "use strict";
9 |
10 | /**
11 | *
12 | * @type {{}}
13 | */
14 | var A = {};
15 |
16 | /**
17 | *
18 | * @param oParam
19 | * @param sContent
20 | */
21 | A.x = function () {
22 | jQuery.sap.extend(false, {}, {}, {});
23 | jQuery.sap.uid();
24 | };
25 |
26 | return A;
27 | }, /* bExport= */ true);
--------------------------------------------------------------------------------
/test/reporter/ReporterTest.ts:
--------------------------------------------------------------------------------
1 | const assert = require("assert");
2 | import {CompareReportLevel, ReportLevel} from "../../src/reporter/Reporter";
3 |
4 | describe("Reporter", () => {
5 | it("CompareReportLevel", () => {
6 | assert.equal(
7 | CompareReportLevel(ReportLevel.TRACE, ReportLevel.INFO),
8 | -1
9 | );
10 | assert.equal(
11 | CompareReportLevel(ReportLevel.INFO, ReportLevel.TRACE),
12 | 1
13 | );
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/test/taskRunner/file1.expected.js:
--------------------------------------------------------------------------------
1 | const a = asd1({
2 | x: 5
3 | });
4 | a();
--------------------------------------------------------------------------------
/test/taskRunner/file1.js:
--------------------------------------------------------------------------------
1 | const a = jQuery.asd1({
2 | x: 5
3 | });
4 | a();
--------------------------------------------------------------------------------
/test/taskRunner/file2.expected.js:
--------------------------------------------------------------------------------
1 | const a = asd2({
2 | x: 5
3 | });
4 | a();
--------------------------------------------------------------------------------
/test/taskRunner/file2.js:
--------------------------------------------------------------------------------
1 | const a = jQuery.asd2({
2 | x: 5
3 | });
4 | a();
--------------------------------------------------------------------------------
/test/taskRunner/jquery0.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "modules": {
3 | "sap/ui/thirdparty/jquery": {
4 | "jQuery": {
5 | "newModulePath": "sap/ui/thirdparty/jquery",
6 | "newVariableName": "jQuery",
7 | "version": "^1.58.0"
8 | },
9 | "jQuery.isEmptyObject": {
10 | "newModulePath": "sap/ui/thirdparty/jquery",
11 | "newVariableName": "jQuery",
12 | "functionName": "isEmptyObject",
13 | "version": "^1.58.0"
14 | }
15 | }
16 | },
17 | "replacers": {
18 | "ModuleFunction": "tasks/helpers/replacers/ModuleFunction.js",
19 | "Module": "tasks/helpers/replacers/Module.js"
20 | }
21 | }
--------------------------------------------------------------------------------
/test/taskRunner/jquery0.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define(["sap/ui/thirdparty/jquery"], function(jQuery) {
2 | return jQuery.isEmptyObject();
3 | });
--------------------------------------------------------------------------------
/test/taskRunner/jquery0.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | return jQuery.isEmptyObject();
3 | });
--------------------------------------------------------------------------------
/test/util/CLIUtilsTest.ts:
--------------------------------------------------------------------------------
1 | import {parseNamespaces} from "../../src/util/CLIUtils";
2 |
3 | const assert = require("assert");
4 |
5 | describe("ConfigUtilsTest", () => {
6 | describe("matchesVersion: (happy path)", () => {
7 | it("Should succeed if valid version range was given", () => {
8 | assert.deepEqual(
9 | parseNamespaces(["a.b.c:src/x", "d.e.f:../"]),
10 | [
11 | {namespace: "a.b.c", filePath: "src/x"},
12 | {namespace: "d.e.f", filePath: "../"},
13 | ],
14 | "Target version and given version range match"
15 | );
16 | });
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/test/util/ModuleNameComparatorTest.ts:
--------------------------------------------------------------------------------
1 | import * as ModuleNameComparator from "../../src/util/ModuleNameComparator";
2 |
3 | const assert = require("assert");
4 |
5 | describe("ConfigUtilsTest", () => {
6 | it("Should succeed if valid version range was given", () => {
7 | assert.ok(
8 | ModuleNameComparator.compare("window.a", "a"),
9 | "window prefix is ignored"
10 | );
11 | assert.ok(
12 | ModuleNameComparator.compare("self.a", "a"),
13 | "self prefix is ignored"
14 | );
15 | assert.ok(
16 | ModuleNameComparator.compare("window.self.a", "a"),
17 | "window.self prefix is ignored"
18 | );
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/test/util/file/FileFilterTest.ts:
--------------------------------------------------------------------------------
1 | import {FileFilter} from "../../../src/util/file/FileFilter";
2 |
3 | const assert = require("assert");
4 |
5 | describe("FileFilter", () => {
6 | it("should be possible to filter using FileFilter", () => {
7 | const fsFilter = FileFilter.create("myfolder", "myfolder/myfile.js");
8 | assert.equal(fsFilter.getDir(), "myfolder");
9 | assert.ok(fsFilter.match("myfolder/myfile.js"), "matches the file");
10 | assert.ok(
11 | !fsFilter.match("myfolder/myfile2.js"),
12 | "matches not the file"
13 | );
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/test/util/file/FolderFilterTest.ts:
--------------------------------------------------------------------------------
1 | import {FolderFilter} from "../../../src/util/file/FolderFilter";
2 |
3 | const assert = require("assert");
4 |
5 | describe("FolderFilter", () => {
6 | it("should be possible to filter using FilderFilter", () => {
7 | const fsFilter = FolderFilter.create("myfolder");
8 | assert.equal(fsFilter.getDir(), "myfolder");
9 | assert.ok(fsFilter.match("myfolder"), "matches the file");
10 | assert.ok(!fsFilter.match("myfold2er"), "matches not the file");
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/test/util/file/GlobFilterTest.ts:
--------------------------------------------------------------------------------
1 | import {GlobFilter} from "../../../src/util/file/GlobFilter";
2 |
3 | const assert = require("assert");
4 |
5 | describe("GlobFilter", () => {
6 | it("should be possible to filter using GlobFilter", () => {
7 | const fsFilter = GlobFilter.create("myfolder", "myfolder/**/*.js");
8 | assert.equal(fsFilter.getDir(), "myfolder");
9 | assert.ok(fsFilter.match("myfolder/myfile.js"), "matches the file");
10 | assert.ok(
11 | fsFilter.match("myfolder/sub/myfile2.js"),
12 | "matches not the file"
13 | );
14 | assert.ok(
15 | !fsFilter.match("myfolder2/sub/myfile2.js"),
16 | "matches not the file"
17 | );
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/test/util/whitespace/astresources/abap.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.require([
2 | "sap/ushell_abap/bootstrap/evo/abap.load.launchpad",
3 | "sap/ushell/services/Container",
4 | "sap/ui/thirdparty/jquery"
5 | ], function (fnLoadLaunchpad, oContainer, jQuery) {
6 | /* global QUnit sinon jQuery start*/
7 | "use strict";
8 |
9 | var oAddContractStub;
10 |
11 | var fnRequireSpy = sinon.stub(sap.ui, "require"),
12 | fnGetUriParameters = sinon.stub(jQuery.sap, "getUriParameters").returns({
13 |
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/test/util/whitespace/astresources/abap.modified.js:
--------------------------------------------------------------------------------
1 | sap.ui.require([
2 | "sap/ushell_abap/bootstrap/evo/abap.load.launchpad",
3 | "sap/ushell/services/Container"
4 | , "sap/ui/thirdparty/jquery"], function (fnLoadLaunchpad, oContainer, jQuery) {
5 | /* global QUnit sinon jQuery start*/
6 | "use strict";
7 |
8 | var oAddContractStub;
9 |
10 | var fnRequireSpy = sinon.stub(sap.ui, "require"),
11 | fnGetUriParameters = sinon.stub(jQuery.sap, "getUriParameters").returns({
12 |
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/test/util/whitespace/astresources/abap.source.js:
--------------------------------------------------------------------------------
1 | sap.ui.require([
2 | "sap/ushell_abap/bootstrap/evo/abap.load.launchpad",
3 | "sap/ushell/services/Container"
4 | ], function (fnLoadLaunchpad, oContainer) {
5 | /* global QUnit sinon jQuery start*/
6 | "use strict";
7 |
8 | var oAddContractStub;
9 |
10 | var fnRequireSpy = sinon.stub(sap.ui, "require"),
11 | fnGetUriParameters = sinon.stub(jQuery.sap, "getUriParameters").returns({
12 |
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/test/util/whitespace/astresources/actions.expected.js:
--------------------------------------------------------------------------------
1 | // ${copyright}
2 | /**
3 | * @fileOverview The actions
contract.
4 | * since 1.32 the types
contract.
5 | */
6 | sap.ui.define(["sap/ui2/srvc/chip", "sap/ui/thirdparty/jquery"], function(chip, jQuery) {
7 | "use strict";
8 | /*global jQuery, sap */
9 |
10 | // Note: jQuery might not yet be available!
11 | if (typeof jQuery === "function" && jQuery.sap) {
12 | // TODO: migration not possible. jQuery.sap.declare is deprecated. Use sap.ui.define
instead.
13 | jQuery.sap.declare("sap.ui2.srvc.contracts.actions");
14 | }
15 | return 47;
16 |
17 |
18 | });
19 |
--------------------------------------------------------------------------------
/test/util/whitespace/astresources/actions.modified.js:
--------------------------------------------------------------------------------
1 | // ${copyright}
2 | /**
3 | * @fileOverview The actions
contract.
4 | * since 1.32 the types
contract.
5 | */
6 | sap.ui.define(["sap/ui2/srvc/chip", "sap/ui/thirdparty/jquery"], function(chip, jQuery) {
7 | "use strict";
8 | /*global jQuery, sap */
9 |
10 | // Note: jQuery might not yet be available!
11 | if (typeof jQuery === "function" && jQuery.sap) {
12 | // TODO: migration not possible. jQuery.sap.declare is deprecated. Use sap.ui.define
instead.
13 | jQuery.sap.declare("sap.ui2.srvc.contracts.actions");
14 | }
15 | return 47;
16 |
17 |
18 | });
19 |
--------------------------------------------------------------------------------
/test/util/whitespace/astresources/actions.source.js:
--------------------------------------------------------------------------------
1 | // ${copyright}
2 | /**
3 | * @fileOverview The actions
contract.
4 | * since 1.32 the types
contract.
5 | */
6 | (function () {
7 | "use strict";
8 | /*global jQuery, sap */
9 |
10 | // Note: jQuery might not yet be available!
11 | if (typeof jQuery === "function" && jQuery.sap) {
12 | jQuery.sap.declare("sap.ui2.srvc.contracts.actions");
13 | jQuery.sap.declare("sap.ui2.srvc.contracts.types");
14 | jQuery.sap.require("sap.ui2.srvc.chip");
15 | }
16 | return 47;
17 |
18 |
19 | }());
20 |
--------------------------------------------------------------------------------
/test/util/whitespace/astresources/comment.expected.js:
--------------------------------------------------------------------------------
1 | // my comment
2 | sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent) {
3 | "use strict";
4 | });
--------------------------------------------------------------------------------
/test/util/whitespace/astresources/comment.modified.js:
--------------------------------------------------------------------------------
1 | // my comment
2 | sap.ui.define(["sap/ui/core/UIComponent"], function(UIComponent) {
3 | "use strict";
4 | });
--------------------------------------------------------------------------------
/test/util/whitespace/astresources/comment.source.js:
--------------------------------------------------------------------------------
1 | jQuery.sap.require("sap.ui.core.UIComponent");
2 | // my comment
3 | jQuery.sap.declare("a.b.c.Component");
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/abap.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.require([
2 | "sap/ushell_abap/bootstrap/evo/abap.load.launchpad",
3 | "sap/ushell/services/Container",
4 | "sap/ui/thirdparty/jquery"
5 | ], function (fnLoadLaunchpad, oContainer, jQuery) {
6 | /* global QUnit sinon jQuery start*/
7 | "use strict";
8 |
9 | var oAddContractStub;
10 |
11 | var fnRequireSpy = sinon.stub(sap.ui, "require"),
12 | fnGetUriParameters = sinon.stub(jQuery.sap, "getUriParameters").returns({
13 |
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/abap.modified.js:
--------------------------------------------------------------------------------
1 | sap.ui.require(["sap/ushell_abap/bootstrap/evo/abap.load.launchpad", "sap/ushell/services/Container", "sap/ui/thirdparty/jquery"], function(fnLoadLaunchpad, oContainer, jQuery) {
2 | /* global QUnit sinon jQuery start*/
3 | "use strict";
4 |
5 | var oAddContractStub;
6 |
7 | var fnRequireSpy = sinon.stub(sap.ui, "require"),
8 | fnGetUriParameters = sinon.stub(jQuery.sap, "getUriParameters").returns({
9 |
10 | });
11 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/abap.source.js:
--------------------------------------------------------------------------------
1 | sap.ui.require([
2 | "sap/ushell_abap/bootstrap/evo/abap.load.launchpad",
3 | "sap/ushell/services/Container"
4 | ], function (fnLoadLaunchpad, oContainer) {
5 | /* global QUnit sinon jQuery start*/
6 | "use strict";
7 |
8 | var oAddContractStub;
9 |
10 | var fnRequireSpy = sinon.stub(sap.ui, "require"),
11 | fnGetUriParameters = sinon.stub(jQuery.sap, "getUriParameters").returns({
12 |
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/actions.expected.js:
--------------------------------------------------------------------------------
1 | // ${copyright}
2 | /**
3 | * @fileOverview The actions
contract.
4 | * since 1.32 the types
contract.
5 | */
6 | sap.ui.define(["sap/ui2/srvc/chip", "sap/ui/thirdparty/jquery"], function(chip, jQuery) {
7 | "use strict";
8 | /*global jQuery, sap */
9 |
10 | // Note: jQuery might not yet be available!
11 | if (typeof jQuery === "function" && jQuery.sap) {
12 | // TODO: migration not possible. jQuery.sap.declare is deprecated. Use sap.ui.define
instead.
13 | jQuery.sap.declare("sap.ui2.srvc.contracts.actions");
14 | }
15 | return 47;
16 |
17 |
18 | });
19 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/actions.modified.js:
--------------------------------------------------------------------------------
1 | // ${copyright}
2 | /**
3 | * @fileOverview The actions
contract.
4 | * since 1.32 the types
contract.
5 | */
6 | sap.ui.define(["sap/ui2/srvc/chip", "sap/ui/thirdparty/jquery"], function(chip, jQuery) {
7 | "use strict";
8 | /*global jQuery, sap */
9 |
10 | // Note: jQuery might not yet be available!
11 | if (typeof jQuery === "function" && jQuery.sap) {
12 | // TODO: migration not possible. jQuery.sap.declare is deprecated. Use sap.ui.define
instead.
13 | jQuery.sap.declare("sap.ui2.srvc.contracts.actions");
14 | }
15 | return 47;
16 |
17 |
18 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/actions.source.js:
--------------------------------------------------------------------------------
1 | // ${copyright}
2 | /**
3 | * @fileOverview The actions
contract.
4 | * since 1.32 the types
contract.
5 | */
6 | (function () {
7 | "use strict";
8 | /*global jQuery, sap */
9 |
10 | // Note: jQuery might not yet be available!
11 | if (typeof jQuery === "function" && jQuery.sap) {
12 | jQuery.sap.declare("sap.ui2.srvc.contracts.actions");
13 | jQuery.sap.declare("sap.ui2.srvc.contracts.types");
14 | jQuery.sap.require("sap.ui2.srvc.chip");
15 | }
16 | return 47;
17 |
18 |
19 | }());
20 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/endless.expected.js:
--------------------------------------------------------------------------------
1 |
2 | sap.ui.define(["sap/ui2/srvc/utils"], function (utils) {
3 | "use strict";
4 |
5 |
6 | a();
7 |
8 | });
9 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/endless.modified.js:
--------------------------------------------------------------------------------
1 |
2 | sap.ui.define(["sap/ui2/srvc/utils"], function(utils) {
3 | "use strict";
4 |
5 | a();
6 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/endless.source.js:
--------------------------------------------------------------------------------
1 |
2 | (function () {
3 | "use strict";
4 | /*global jQuery, location, OData, Promise, sap, URI, XMLHttpRequest, window */
5 |
6 | jQuery.sap.require("sap.ui2.srvc.utils");
7 | a();
8 |
9 | }());
10 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/structure.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | "use strict";
3 | /**
4 | * Add test pages to this test suite function.
5 | *
6 | */
7 | function suite() {
8 | var oSuite = new parent.jsUnitTestSuite(),
9 | sContextPath = window.location.pathname.split("test-resources")[0];
10 |
11 | var x = 47;
12 | var y = 11;
13 |
14 | sContextPath(x * y);
15 |
16 | return oSuite;
17 | }
18 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/structure.modified.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | "use strict";
3 | /**
4 | * Add test pages to this test suite function.
5 | *
6 | */
7 | function suite() {
8 | var oSuite = new parent.jsUnitTestSuite(),
9 | sContextPath = window.location.pathname.split("test-resources")[0];
10 |
11 | var x = 47;
12 | var y = 11;
13 |
14 | sContextPath(x * y);
15 |
16 | return oSuite;
17 | }
18 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/structure.source.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Add test pages to this test suite function.
3 | *
4 | */
5 | function suite() {
6 | var oSuite = new parent.jsUnitTestSuite(),
7 | sContextPath = window.location.pathname.split("test-resources")[0];
8 |
9 | var x = 47;
10 | var y = 11;
11 |
12 | sContextPath(x * y);
13 |
14 | return oSuite;
15 | }
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/structure2.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | "use strict";
3 | /* global QUnit */
4 | QUnit.config.autostart = false;
5 |
6 | sap.ui.getCore().attachInit(function () {
7 | "use strict";
8 |
9 | sap.ui.require([
10 | "sap/ushell_abap/plugins/fcc-transport-ui/test/test/integration/AllJourneys"
11 | ], function () {
12 | QUnit.start();
13 | });
14 | });
15 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/structure2.modified.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | "use strict";
3 | /* global QUnit */
4 | QUnit.config.autostart = false;
5 |
6 | sap.ui.getCore().attachInit(function () {
7 | "use strict";
8 |
9 | sap.ui.require([
10 | "sap/ushell_abap/plugins/fcc-transport-ui/test/test/integration/AllJourneys"
11 | ], function () {
12 | QUnit.start();
13 | });
14 | });
15 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffandastresources/structure2.source.js:
--------------------------------------------------------------------------------
1 | /* global QUnit */
2 | QUnit.config.autostart = false;
3 |
4 | sap.ui.getCore().attachInit(function () {
5 | "use strict";
6 |
7 | sap.ui.require([
8 | "sap/ushell_abap/plugins/fcc-transport-ui/test/test/integration/AllJourneys"
9 | ], function () {
10 | QUnit.start();
11 | });
12 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/abap.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.require([
2 | "sap/ushell_abap/bootstrap/evo/abap.load.launchpad",
3 | "sap/ushell/services/Container"
4 | , "sap/ui/thirdparty/jquery"], function (fnLoadLaunchpad, oContainer, jQuery) {
5 | /* global QUnit sinon jQuery start*/
6 | "use strict";
7 |
8 | var oAddContractStub;
9 |
10 | var fnRequireSpy = sinon.stub(sap.ui, "require"),
11 | fnGetUriParameters = sinon.stub(jQuery.sap, "getUriParameters").returns({
12 |
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/abap.modified.js:
--------------------------------------------------------------------------------
1 | sap.ui.require(["sap/ushell_abap/bootstrap/evo/abap.load.launchpad", "sap/ushell/services/Container", "sap/ui/thirdparty/jquery"], function(fnLoadLaunchpad, oContainer, jQuery) {
2 | /* global QUnit sinon jQuery start*/
3 | "use strict";
4 |
5 | var oAddContractStub;
6 |
7 | var fnRequireSpy = sinon.stub(sap.ui, "require"),
8 | fnGetUriParameters = sinon.stub(jQuery.sap, "getUriParameters").returns({
9 |
10 | });
11 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/abap.source.js:
--------------------------------------------------------------------------------
1 | sap.ui.require([
2 | "sap/ushell_abap/bootstrap/evo/abap.load.launchpad",
3 | "sap/ushell/services/Container"
4 | ], function (fnLoadLaunchpad, oContainer) {
5 | /* global QUnit sinon jQuery start*/
6 | "use strict";
7 |
8 | var oAddContractStub;
9 |
10 | var fnRequireSpy = sinon.stub(sap.ui, "require"),
11 | fnGetUriParameters = sinon.stub(jQuery.sap, "getUriParameters").returns({
12 |
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/actions.expected.js:
--------------------------------------------------------------------------------
1 | // ${copyright}
2 | /**
3 | * @fileOverview The actions
contract.
4 | * since 1.32 the types
contract.
5 | */
6 | sap.ui.define(["sap/ui2/srvc/chip", "sap/ui/thirdparty/jquery"], function(chip, jQuery) {
7 | "use strict";
8 | /*global jQuery, sap */
9 |
10 | // Note: jQuery might not yet be available!
11 | if (typeof jQuery === "function" && jQuery.sap) {
12 | // TODO: migration not possible. jQuery.sap.declare is deprecated. Use sap.ui.define
instead.
13 | jQuery.sap.declare("sap.ui2.srvc.contracts.actions");
14 | }
15 | return 47;
16 |
17 |
18 | });
19 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/actions.modified.js:
--------------------------------------------------------------------------------
1 | // ${copyright}
2 | /**
3 | * @fileOverview The actions
contract.
4 | * since 1.32 the types
contract.
5 | */
6 | sap.ui.define(["sap/ui2/srvc/chip", "sap/ui/thirdparty/jquery"], function(chip, jQuery) {
7 | "use strict";
8 | /*global jQuery, sap */
9 |
10 | // Note: jQuery might not yet be available!
11 | if (typeof jQuery === "function" && jQuery.sap) {
12 | // TODO: migration not possible. jQuery.sap.declare is deprecated. Use sap.ui.define
instead.
13 | jQuery.sap.declare("sap.ui2.srvc.contracts.actions");
14 | }
15 | return 47;
16 |
17 |
18 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/actions.source.js:
--------------------------------------------------------------------------------
1 | // ${copyright}
2 | /**
3 | * @fileOverview The actions
contract.
4 | * since 1.32 the types
contract.
5 | */
6 | (function () {
7 | "use strict";
8 | /*global jQuery, sap */
9 |
10 | // Note: jQuery might not yet be available!
11 | if (typeof jQuery === "function" && jQuery.sap) {
12 | jQuery.sap.declare("sap.ui2.srvc.contracts.actions");
13 | jQuery.sap.declare("sap.ui2.srvc.contracts.types");
14 | jQuery.sap.require("sap.ui2.srvc.chip");
15 | }
16 | return 47;
17 |
18 |
19 | }());
20 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/endless.expected.js:
--------------------------------------------------------------------------------
1 |
2 | sap.ui.define(["sap/ui2/srvc/utils"], function (utils) {
3 | "use strict";
4 |
5 | });
6 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/endless.modified.js:
--------------------------------------------------------------------------------
1 |
2 | sap.ui.define(["sap/ui2/srvc/utils"], function(utils) {
3 | "use strict";
4 |
5 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/endless.source.js:
--------------------------------------------------------------------------------
1 |
2 | (function () {
3 | "use strict";
4 | /*global jQuery, location, OData, Promise, sap, URI, XMLHttpRequest, window */
5 |
6 | jQuery.sap.require("sap.ui2.srvc.utils");
7 |
8 | }());
9 |
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/structure.expected.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | "use strict";
3 | /**
4 | * Add test pages to this test suite function.
5 | *
6 | */
7 | function suite() {
8 | var oSuite = new parent.jsUnitTestSuite(),
9 | sContextPath = window.location.pathname.split("test-resources")[0];
10 |
11 | return oSuite;
12 | }
13 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/structure.modified.js:
--------------------------------------------------------------------------------
1 | sap.ui.define([], function() {
2 | "use strict";
3 | /**
4 | * Add test pages to this test suite function.
5 | *
6 | */
7 | function suite() {
8 | var oSuite = new parent.jsUnitTestSuite(),
9 | sContextPath = window.location.pathname.split("test-resources")[0];
10 |
11 | return oSuite;
12 | }
13 | });
--------------------------------------------------------------------------------
/test/util/whitespace/diffresources/structure.source.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Add test pages to this test suite function.
3 | *
4 | */
5 | function suite() {
6 | var oSuite = new parent.jsUnitTestSuite(),
7 | sContextPath = window.location.pathname.split("test-resources")[0];
8 |
9 | return oSuite;
10 | }
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./node_modules/gts/tsconfig-google.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "allowUnreachableCode": false,
6 | "outDir": "js",
7 | "sourceMap": true,
8 | "target": "es2017",
9 | "newLine": "lf",
10 | "strict": false,
11 | "noImplicitReturns": true,
12 | "resolveJsonModule": true,
13 | "typeRoots": [
14 | "typings",
15 | "node_modules/@types"
16 | ]
17 | },
18 | "ts-node": {
19 | "files": true
20 | },
21 | "include": [
22 | "defaultConfig/*.json",
23 | "typings/*.ts",
24 | "src/*.ts",
25 | "src/**/*.ts",
26 | "test/*.ts",
27 | "test/**/*.ts"
28 | ],
29 | "exclude": [
30 | "node_modules"
31 | ]
32 | }
33 |
--------------------------------------------------------------------------------