@lcap/nasl 3.3.3-beta.8 → 3.3.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nyc_output/{78804420-ead6-486f-b682-ab54ccd95dc9.json → d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json} +1 -1
- package/.nyc_output/processinfo/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/coverage/index.html +126 -141
- package/coverage/src/automate/engine/index.html +1 -1
- package/coverage/src/automate/engine/utils.js.html +36 -36
- package/coverage/src/bak/index.html +14 -14
- package/coverage/src/bak/translator.js.html +57 -393
- package/coverage/src/breakpoint/generator/AfterStartNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/BeforeEndNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/BreakpointNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/CallbackNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/index.html +1 -1
- package/coverage/src/breakpoint/generator/index.ts.html +1 -1
- package/coverage/src/breakpoint/index.html +1 -1
- package/coverage/src/breakpoint/index.ts.html +1 -1
- package/coverage/src/breakpoint/shared/constants.ts.html +1 -1
- package/coverage/src/breakpoint/shared/index.html +1 -1
- package/coverage/src/breakpoint/shared/index.ts.html +1 -1
- package/coverage/src/breakpoint/shared/operations.ts.html +2 -2
- package/coverage/src/breakpoint/shared/socket.ts.html +1 -1
- package/coverage/src/breakpoint/shared/utils.ts.html +1 -1
- package/coverage/src/breakpoint/store/core.ts.html +3 -3
- package/coverage/src/breakpoint/store/dock.ts.html +1 -1
- package/coverage/src/breakpoint/store/index.html +1 -1
- package/coverage/src/breakpoint/store/index.ts.html +1 -1
- package/coverage/src/common/BaseNode.ts.html +164 -593
- package/coverage/src/common/Command.ts.html +1 -1
- package/coverage/src/common/EventEmitter.ts.html +31 -31
- package/coverage/src/common/Messager.ts.html +1 -1
- package/coverage/src/common/asyncFuncMap.ts.html +1 -1
- package/coverage/src/common/index.html +23 -38
- package/coverage/src/common/index.ts.html +4 -7
- package/coverage/src/concepts/Abort__.ts.html +9 -39
- package/coverage/src/concepts/Anchor__.ts.html +29 -86
- package/coverage/src/concepts/AnonymousFunction__.ts.html +169 -262
- package/coverage/src/concepts/App__.ts.html +152 -1205
- package/coverage/src/concepts/Argument__.ts.html +53 -137
- package/coverage/src/concepts/Assignee__.ts.html +34 -124
- package/coverage/src/concepts/AssignmentLine__.ts.html +15 -48
- package/coverage/src/concepts/Assignment__.ts.html +81 -213
- package/coverage/src/concepts/Attribute__.ts.html +14 -41
- package/coverage/src/concepts/AuthInterface__.ts.html +6 -9
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +144 -108
- package/coverage/src/concepts/AuthLogic__.ts.html +6 -18
- package/coverage/src/concepts/BackendVariable__.ts.html +48 -168
- package/coverage/src/concepts/Backend__.ts.html +28 -106
- package/coverage/src/concepts/BatchAssignment__.ts.html +169 -274
- package/coverage/src/concepts/BinaryExpression__.ts.html +129 -285
- package/coverage/src/concepts/BindAttribute__.ts.html +111 -522
- package/coverage/src/concepts/BindDirective__.ts.html +26 -131
- package/coverage/src/concepts/BindEvent__.ts.html +64 -160
- package/coverage/src/concepts/BindStyle__.ts.html +21 -78
- package/coverage/src/concepts/BooleanLiteral__.ts.html +20 -47
- package/coverage/src/concepts/CallAuthInterface__.ts.html +48 -105
- package/coverage/src/concepts/CallConnector__.ts.html +35 -62
- package/coverage/src/concepts/CallFunction__.ts.html +144 -288
- package/coverage/src/concepts/CallInterface__.ts.html +60 -93
- package/coverage/src/concepts/CallLogic__.ts.html +343 -292
- package/coverage/src/concepts/CallQueryComponent__.ts.html +93 -126
- package/coverage/src/concepts/Comment__.ts.html +10 -43
- package/coverage/src/concepts/CompletionProperty__.ts.html +13 -40
- package/coverage/src/concepts/ConfigGroup__.ts.html +20 -47
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +19 -22
- package/coverage/src/concepts/ConfigProperty__.ts.html +40 -97
- package/coverage/src/concepts/Configuration__.ts.html +21 -48
- package/coverage/src/concepts/Connection__.ts.html +22 -97
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +6 -9
- package/coverage/src/concepts/Connector__.ts.html +38 -161
- package/coverage/src/concepts/Constant__.ts.html +24 -84
- package/coverage/src/concepts/DataSource__.ts.html +57 -111
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +6 -9
- package/coverage/src/concepts/Destination__.ts.html +55 -97
- package/coverage/src/concepts/End__.ts.html +21 -51
- package/coverage/src/concepts/EntityIndex__.ts.html +10 -40
- package/coverage/src/concepts/EntityProperty__.ts.html +56 -164
- package/coverage/src/concepts/Entity__.ts.html +89 -167
- package/coverage/src/concepts/EnumItem__.ts.html +10 -40
- package/coverage/src/concepts/Enum__.ts.html +24 -84
- package/coverage/src/concepts/Event__.ts.html +14 -41
- package/coverage/src/concepts/ExternalDestination__.ts.html +21 -75
- package/coverage/src/concepts/ForEachStatement__.ts.html +64 -139
- package/coverage/src/concepts/FrontendLibrary__.ts.html +20 -71
- package/coverage/src/concepts/FrontendVariable__.ts.html +1 -1
- package/coverage/src/concepts/Frontend__.ts.html +57 -213
- package/coverage/src/concepts/Function__.ts.html +86 -239
- package/coverage/src/concepts/Identifier__.ts.html +72 -111
- package/coverage/src/concepts/IfStatement__.ts.html +75 -138
- package/coverage/src/concepts/Integration__.ts.html +19 -70
- package/coverage/src/concepts/InterfaceParam__.ts.html +21 -78
- package/coverage/src/concepts/Interface__.ts.html +60 -162
- package/coverage/src/concepts/JSBlock__.ts.html +11 -215
- package/coverage/src/concepts/JavaLogic__.ts.html +9 -42
- package/coverage/src/concepts/LogicItem__.ts.html +21 -51
- package/coverage/src/concepts/Logic__.ts.html +321 -405
- package/coverage/src/concepts/MatchCase__.ts.html +97 -181
- package/coverage/src/concepts/Match__.ts.html +59 -116
- package/coverage/src/concepts/MemberExpression__.ts.html +128 -182
- package/coverage/src/concepts/MicroApp__.ts.html +6 -9
- package/coverage/src/concepts/Module__.ts.html +18 -672
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +14 -41
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +14 -41
- package/coverage/src/concepts/Namespace__.ts.html +91 -358
- package/coverage/src/concepts/NewComposite__.ts.html +125 -278
- package/coverage/src/concepts/NewList__.ts.html +57 -195
- package/coverage/src/concepts/NewMap__.ts.html +63 -168
- package/coverage/src/concepts/New__.ts.html +9 -39
- package/coverage/src/concepts/NullLiteral__.ts.html +9 -36
- package/coverage/src/concepts/NumericLiteral__.ts.html +33 -90
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +35 -161
- package/coverage/src/concepts/OverriddenLogic__.ts.html +201 -324
- package/coverage/src/concepts/Param__.ts.html +75 -189
- package/coverage/src/concepts/Point__.ts.html +6 -9
- package/coverage/src/concepts/ProcessComponent__.ts.html +21 -72
- package/coverage/src/concepts/ProcessElement__.ts.html +115 -316
- package/coverage/src/concepts/ProcessOutcome__.ts.html +13 -85
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +13 -85
- package/coverage/src/concepts/Process__.ts.html +70 -211
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +16 -67
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +11 -41
- package/coverage/src/concepts/QueryFromExpression__.ts.html +21 -81
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +19 -70
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +25 -85
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +20 -77
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +20 -80
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +15 -42
- package/coverage/src/concepts/Rect__.ts.html +6 -9
- package/coverage/src/concepts/Return__.ts.html +44 -164
- package/coverage/src/concepts/Role__.ts.html +15 -45
- package/coverage/src/concepts/SelectMembers__.ts.html +24 -81
- package/coverage/src/concepts/Slot__.ts.html +13 -40
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +24 -84
- package/coverage/src/concepts/Start__.ts.html +9 -36
- package/coverage/src/concepts/StringInterpolation__.ts.html +29 -104
- package/coverage/src/concepts/StringLiteral__.ts.html +32 -62
- package/coverage/src/concepts/StructureProperty__.ts.html +23 -80
- package/coverage/src/concepts/Structure__.ts.html +32 -116
- package/coverage/src/concepts/SwitchCase__.ts.html +36 -87
- package/coverage/src/concepts/SwitchStatement__.ts.html +33 -90
- package/coverage/src/concepts/Theme__.ts.html +12 -15
- package/coverage/src/concepts/Transactional__.ts.html +6 -9
- package/coverage/src/concepts/TriggerEvent__.ts.html +14 -41
- package/coverage/src/concepts/TriggerLauncher__.ts.html +13 -46
- package/coverage/src/concepts/TypeAnnotation__.ts.html +116 -347
- package/coverage/src/concepts/TypeParam__.ts.html +12 -42
- package/coverage/src/concepts/UnaryExpression__.ts.html +27 -105
- package/coverage/src/concepts/Unparsed__.ts.html +12 -36
- package/coverage/src/concepts/UseComponent__.ts.html +6 -9
- package/coverage/src/concepts/ValidationRule__.ts.html +40 -79
- package/coverage/src/concepts/Variable__.ts.html +37 -157
- package/coverage/src/concepts/ViewBlock__.ts.html +6 -9
- package/coverage/src/concepts/ViewComponent__.ts.html +24 -99
- package/coverage/src/concepts/ViewElement__.ts.html +278 -692
- package/coverage/src/concepts/View__.ts.html +163 -517
- package/coverage/src/concepts/WhileStatement__.ts.html +55 -118
- package/coverage/src/concepts/basics/stdlib/index.html +1 -1
- package/coverage/src/concepts/basics/stdlib/index.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.auth.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.browser.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.collection.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.configuration.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.core.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.event.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.http.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.interface.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.io.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.logging.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.process.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +3 -3
- package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +1 -1
- package/coverage/src/concepts/basics/types/coreTypeList.ts.html +1 -1
- package/coverage/src/concepts/basics/types/index.html +1 -1
- package/coverage/src/concepts/basics/types/index.ts.html +1 -1
- package/coverage/src/concepts/index.html +965 -980
- package/coverage/src/concepts/index.ts.html +1 -1
- package/coverage/src/concepts/index__.ts.html +4 -7
- package/coverage/src/config.ts.html +1 -1
- package/coverage/src/decorators/index.html +5 -5
- package/coverage/src/decorators/index.ts.html +32 -32
- package/coverage/src/decorators/promise.ts.html +10 -10
- package/coverage/src/eventBus.ts.html +1 -1
- package/coverage/src/generator/compileComponent.ts.html +4 -4
- package/coverage/src/generator/genBundleFiles.ts.html +23 -17
- package/coverage/src/generator/genHash.ts.html +3 -3
- package/coverage/src/generator/genMetaData.ts.html +16 -103
- package/coverage/src/generator/genReleaseBody.ts.html +3 -3
- package/coverage/src/generator/icestark.ts.html +4 -10
- package/coverage/src/generator/index.html +21 -21
- package/coverage/src/generator/index.ts.html +1 -1
- package/coverage/src/generator/microApp.ts.html +1 -1
- package/coverage/src/generator/permission.ts.html +20 -92
- package/coverage/src/generator/qiankun.ts.html +3 -9
- package/coverage/src/generator/styleReplacer.ts.html +1 -1
- package/coverage/src/index.html +7 -7
- package/coverage/src/index.ts.html +4 -4
- package/coverage/src/manager/diagnostic.ts.html +14 -11
- package/coverage/src/manager/index.html +13 -13
- package/coverage/src/manager/stepRecorder.ts.html +1 -1
- package/coverage/src/natural/genNaturalTS.ts.html +1 -1
- package/coverage/src/natural/index.html +15 -15
- package/coverage/src/natural/index.ts.html +1 -1
- package/coverage/src/natural/naslStdlibMap.ts.html +1 -1
- package/coverage/src/natural/transformTSCode.ts.html +18 -78
- package/coverage/src/sentry/index.html +14 -14
- package/coverage/src/sentry/index.ts.html +32 -38
- package/coverage/src/server/createUiTs.ts.html +6 -15
- package/coverage/src/server/entity2LogicNamespace.ts.html +9 -9
- package/coverage/src/server/event.js.html +1 -1
- package/coverage/src/server/extendBaseNode.ts.html +4 -7
- package/coverage/src/server/formatTsUtils.ts.html +9 -9
- package/coverage/src/server/getConnector.ts.html +1 -1
- package/coverage/src/server/getExtensionModules.ts.html +1 -1
- package/coverage/src/server/getFunctions.ts.html +4 -4
- package/coverage/src/server/getInterfaces.ts.html +1 -1
- package/coverage/src/server/getLogging.ts.html +2 -2
- package/coverage/src/server/getLogics.ts.html +1 -1
- package/coverage/src/server/getMemberIdentifier.ts.html +119 -167
- package/coverage/src/server/getProcessComponents.ts.html +3 -3
- package/coverage/src/server/getProcesses.ts.html +1 -1
- package/coverage/src/server/getValidates.ts.html +4 -4
- package/coverage/src/server/index.html +34 -34
- package/coverage/src/server/index.ts.html +1 -1
- package/coverage/src/server/naslServer.ts.html +943 -1195
- package/coverage/src/server/naslStdlibMap.ts.html +1 -1
- package/coverage/src/server/process2LogicNamespace.ts.html +52 -52
- package/coverage/src/server/translator.ts.html +14 -50
- package/coverage/src/service/creator/add.configs.js.html +9 -27
- package/coverage/src/service/creator/errHandles.js.html +37 -19
- package/coverage/src/service/creator/index.html +22 -22
- package/coverage/src/service/creator/index.js.html +1 -1
- package/coverage/src/service/datasource/api.js.html +1 -1
- package/coverage/src/service/datasource/index.html +1 -1
- package/coverage/src/service/datasource/index.js.html +1 -1
- package/coverage/src/service/logic/api.js.html +1 -1
- package/coverage/src/service/logic/index.html +1 -1
- package/coverage/src/service/logic/index.js.html +1 -1
- package/coverage/src/service/storage/api.js.html +1 -1
- package/coverage/src/service/storage/index.html +29 -29
- package/coverage/src/service/storage/index.ts.html +1 -1
- package/coverage/src/service/storage/init.ts.html +601 -1534
- package/coverage/src/service/storage/jsoner.ts.html +13 -76
- package/coverage/src/service/storage/map.ts.html +3 -3
- package/coverage/src/service/storage/service.ts.html +1 -1
- package/coverage/src/service/storage/storagePoint.ts.html +1 -1
- package/coverage/src/templator/genCallComponentLogic.ts.html +1 -1
- package/coverage/src/templator/genCreateBlock.ts.html +56 -47
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +31 -49
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +89 -80
- package/coverage/src/templator/genEditTableBlock.ts.html +11 -80
- package/coverage/src/templator/genEnumSelectBlock.ts.html +1 -1
- package/coverage/src/templator/genGetBlock.ts.html +1 -1
- package/coverage/src/templator/genGridViewBlock.ts.html +1 -1
- package/coverage/src/templator/genListViewBlock.ts.html +1 -1
- package/coverage/src/templator/genQueryComponent.ts.html +1 -1
- package/coverage/src/templator/genSelectBlock.ts.html +1 -1
- package/coverage/src/templator/genTableBlock.ts.html +3 -66
- package/coverage/src/templator/genUpdateBlock.ts.html +36 -48
- package/coverage/src/templator/index.html +39 -39
- package/coverage/src/templator/index.ts.html +1 -1
- package/coverage/src/templator/utils.ts.html +11 -77
- package/coverage/src/translator/constant.ts.html +1 -1
- package/coverage/src/translator/index.html +21 -21
- package/coverage/src/translator/index.ts.html +1 -1
- package/coverage/src/translator/utils.ts.html +68 -389
- package/coverage/src/utils/cookie.ts.html +4 -4
- package/coverage/src/utils/env.ts.html +1 -1
- package/coverage/src/utils/index.html +51 -36
- package/coverage/src/utils/index.ts.html +22 -115
- package/coverage/src/utils/logger.ts.html +13 -13
- package/coverage/src/utils/sortTsString.ts.html +10 -25
- package/coverage/src/utils/string.ts.html +8 -110
- package/coverage/src/utils/time-slicing.ts.html +1 -1
- package/coverage/src/utils/traverse.ts.html +1 -1
- package/coverage/src/utils/window.ts.html +1 -1
- package/out/bak/translator.js.map +1 -1
- package/out/common/Command.js +1 -1
- package/out/common/Command.js.map +1 -1
- package/out/concepts/Argument__.js +7 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignment__.js +20 -3
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +24 -2
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +40 -13
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/CallLogic__.js +7 -12
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CountersignPolicy__.d.ts +26 -0
- package/out/concepts/CountersignPolicy__.js +73 -0
- package/out/concepts/CountersignPolicy__.js.map +1 -0
- package/out/concepts/ForEachStatement__.js +12 -26
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Identifier__.js +3 -0
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/JSBlock__.js +56 -0
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.js +2 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +2 -0
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Match__.js +1 -1
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MultiApprovalPolicy__.d.ts +24 -0
- package/out/concepts/MultiApprovalPolicy__.js +65 -0
- package/out/concepts/MultiApprovalPolicy__.js.map +1 -0
- package/out/concepts/NewComposite__.js +18 -10
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.js +24 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +16 -0
- package/out/concepts/ProcessElement__.js +56 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Return__.js +24 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/SequentialPolicy__.d.ts +18 -0
- package/out/concepts/SequentialPolicy__.js +54 -0
- package/out/concepts/SequentialPolicy__.js.map +1 -0
- package/out/concepts/Variable__.js +24 -2
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +2 -2
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/index__.d.ts +3 -0
- package/out/concepts/index__.js +3 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/types__.d.ts +4 -1
- package/out/generator/genReleaseBody.js +2 -2
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/server/extendBaseNode.js +32 -1
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/getLogics.d.ts +1 -0
- package/out/server/getLogics.js +6 -2
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getProcesses.js +66 -6
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.js +2 -2
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +3 -0
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/errHandles.js +6 -3
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/storage/init.js +2 -2
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +9 -5
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +18 -12
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +10 -8
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +3 -2
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +12 -9
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.js.map +1 -1
- package/package.json +2 -2
- package/sandbox/stdlib/nasl.core.ts +2 -0
- package/sandbox/stdlib/nasl.util.ts +3 -3
- package/src/bak/translator.js +0 -1
- package/src/common/Command.ts +1 -1
- package/src/concepts/Argument__.ts +7 -2
- package/src/concepts/Assignment__.ts +31 -13
- package/src/concepts/BackendVariable__.ts +22 -3
- package/src/concepts/BinaryExpression__.ts +39 -13
- package/src/concepts/CallLogic__.ts +13 -23
- package/src/concepts/CountersignPolicy__.ts +77 -0
- package/src/concepts/ForEachStatement__.ts +17 -26
- package/src/concepts/Identifier__.ts +4 -1
- package/src/concepts/JSBlock__.ts +58 -0
- package/src/concepts/LogicItem__.ts +2 -2
- package/src/concepts/Logic__.ts +1 -0
- package/src/concepts/Match__.ts +1 -1
- package/src/concepts/MultiApprovalPolicy__.ts +69 -0
- package/src/concepts/NewComposite__.ts +18 -9
- package/src/concepts/NumericLiteral__.ts +1 -1
- package/src/concepts/Param__.ts +24 -2
- package/src/concepts/ProcessElement__.ts +70 -1
- package/src/concepts/Return__.ts +23 -3
- package/src/concepts/SequentialPolicy__.ts +58 -0
- package/src/concepts/Variable__.ts +23 -3
- package/src/concepts/ViewElement__.ts +6 -4
- package/src/concepts/View__.ts +5 -5
- package/src/concepts/index__.ts +3 -0
- package/src/concepts/types__.ts +6 -0
- package/src/generator/genReleaseBody.ts +40 -40
- package/src/server/extendBaseNode.ts +30 -2
- package/src/server/getLogics.ts +4 -0
- package/src/server/getProcesses.ts +66 -6
- package/src/server/index.ts +2 -1
- package/src/server/naslServer.ts +2 -2
- package/src/server/translator.ts +3 -0
- package/src/service/creator/errHandles.js +7 -4
- package/src/service/storage/init.ts +2 -2
- package/src/templator/genCreateBlock.ts +9 -5
- package/src/templator/genCurdEditMultipleKeyBlock.ts +19 -13
- package/src/templator/genCurdMultipleKeyBlock.ts +14 -11
- package/src/templator/genEditTableBlock.ts +4 -2
- package/src/templator/genUpdateBlock.ts +15 -12
- package/src/templator/utils.ts +8 -7
- package/test/concepts/anonymous-function/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/assignment/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/batch-assignment/__snapshots__/toJS.spec.ts.snap +2 -2
- package/test/concepts/binary-expression/__snapshots__/toJS.spec.ts.snap +3 -2
- package/test/concepts/call-interface/__snapshots__/toJS.spec.ts.snap +2 -2
- package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +3 -3
- package/test/concepts/match/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/numeric-literal/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +3 -3
- package/.nyc_output/processinfo/78804420-ead6-486f-b682-ab54ccd95dc9.json +0 -1
- package/coverage/cobertura-coverage.xml +0 -71878
- package/coverage/src/automate/engine/index.js.html +0 -1471
- package/coverage/src/automate/engine/operators.js.html +0 -862
- package/coverage/src/automate/engine/uniqueName.js.html +0 -412
- package/coverage/src/automate/engine/viewCache.js.html +0 -214
- package/coverage/src/automate/template/index.html +0 -116
- package/coverage/src/automate/template/myProcess.js.html +0 -34645
- package/coverage/src/common/utils.ts.html +0 -136
- package/coverage/src/concepts/DataElement__.ts.html +0 -118
- package/coverage/src/concepts/MetadataType__.ts.html +0 -2053
- package/coverage/src/utils/time-slicing/constant.ts.html +0 -196
- package/coverage/src/utils/time-slicing/controller.ts.html +0 -1111
- package/coverage/src/utils/time-slicing/index.html +0 -236
- package/coverage/src/utils/time-slicing/index.ts.html +0 -103
- package/coverage/src/utils/time-slicing/page-state.ts.html +0 -121
- package/coverage/src/utils/time-slicing/performance.ts.html +0 -253
- package/coverage/src/utils/time-slicing/runner.ts.html +0 -247
- package/coverage/src/utils/time-slicing/tool.ts.html +0 -220
- package/coverage/src/utils/time-slicing/utils.ts.html +0 -355
- package/coverage/src/utils/time-slicing/wrapper.ts.html +0 -259
- package/coverage/src/utils/time.ts.html +0 -118
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">15.
|
|
26
|
+
<span class="strong">15.48% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>107/691</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">8.27% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>25/
|
|
35
|
+
<span class='fraction'>25/302</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">15.03% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>95/632</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -1611,68 +1611,7 @@
|
|
|
1611
1611
|
<a name='L1546'></a><a href='#L1546'>1546</a>
|
|
1612
1612
|
<a name='L1547'></a><a href='#L1547'>1547</a>
|
|
1613
1613
|
<a name='L1548'></a><a href='#L1548'>1548</a>
|
|
1614
|
-
<a name='L1549'></a><a href='#L1549'>1549</a>
|
|
1615
|
-
<a name='L1550'></a><a href='#L1550'>1550</a>
|
|
1616
|
-
<a name='L1551'></a><a href='#L1551'>1551</a>
|
|
1617
|
-
<a name='L1552'></a><a href='#L1552'>1552</a>
|
|
1618
|
-
<a name='L1553'></a><a href='#L1553'>1553</a>
|
|
1619
|
-
<a name='L1554'></a><a href='#L1554'>1554</a>
|
|
1620
|
-
<a name='L1555'></a><a href='#L1555'>1555</a>
|
|
1621
|
-
<a name='L1556'></a><a href='#L1556'>1556</a>
|
|
1622
|
-
<a name='L1557'></a><a href='#L1557'>1557</a>
|
|
1623
|
-
<a name='L1558'></a><a href='#L1558'>1558</a>
|
|
1624
|
-
<a name='L1559'></a><a href='#L1559'>1559</a>
|
|
1625
|
-
<a name='L1560'></a><a href='#L1560'>1560</a>
|
|
1626
|
-
<a name='L1561'></a><a href='#L1561'>1561</a>
|
|
1627
|
-
<a name='L1562'></a><a href='#L1562'>1562</a>
|
|
1628
|
-
<a name='L1563'></a><a href='#L1563'>1563</a>
|
|
1629
|
-
<a name='L1564'></a><a href='#L1564'>1564</a>
|
|
1630
|
-
<a name='L1565'></a><a href='#L1565'>1565</a>
|
|
1631
|
-
<a name='L1566'></a><a href='#L1566'>1566</a>
|
|
1632
|
-
<a name='L1567'></a><a href='#L1567'>1567</a>
|
|
1633
|
-
<a name='L1568'></a><a href='#L1568'>1568</a>
|
|
1634
|
-
<a name='L1569'></a><a href='#L1569'>1569</a>
|
|
1635
|
-
<a name='L1570'></a><a href='#L1570'>1570</a>
|
|
1636
|
-
<a name='L1571'></a><a href='#L1571'>1571</a>
|
|
1637
|
-
<a name='L1572'></a><a href='#L1572'>1572</a>
|
|
1638
|
-
<a name='L1573'></a><a href='#L1573'>1573</a>
|
|
1639
|
-
<a name='L1574'></a><a href='#L1574'>1574</a>
|
|
1640
|
-
<a name='L1575'></a><a href='#L1575'>1575</a>
|
|
1641
|
-
<a name='L1576'></a><a href='#L1576'>1576</a>
|
|
1642
|
-
<a name='L1577'></a><a href='#L1577'>1577</a>
|
|
1643
|
-
<a name='L1578'></a><a href='#L1578'>1578</a>
|
|
1644
|
-
<a name='L1579'></a><a href='#L1579'>1579</a>
|
|
1645
|
-
<a name='L1580'></a><a href='#L1580'>1580</a>
|
|
1646
|
-
<a name='L1581'></a><a href='#L1581'>1581</a>
|
|
1647
|
-
<a name='L1582'></a><a href='#L1582'>1582</a>
|
|
1648
|
-
<a name='L1583'></a><a href='#L1583'>1583</a>
|
|
1649
|
-
<a name='L1584'></a><a href='#L1584'>1584</a>
|
|
1650
|
-
<a name='L1585'></a><a href='#L1585'>1585</a>
|
|
1651
|
-
<a name='L1586'></a><a href='#L1586'>1586</a>
|
|
1652
|
-
<a name='L1587'></a><a href='#L1587'>1587</a>
|
|
1653
|
-
<a name='L1588'></a><a href='#L1588'>1588</a>
|
|
1654
|
-
<a name='L1589'></a><a href='#L1589'>1589</a>
|
|
1655
|
-
<a name='L1590'></a><a href='#L1590'>1590</a>
|
|
1656
|
-
<a name='L1591'></a><a href='#L1591'>1591</a>
|
|
1657
|
-
<a name='L1592'></a><a href='#L1592'>1592</a>
|
|
1658
|
-
<a name='L1593'></a><a href='#L1593'>1593</a>
|
|
1659
|
-
<a name='L1594'></a><a href='#L1594'>1594</a>
|
|
1660
|
-
<a name='L1595'></a><a href='#L1595'>1595</a>
|
|
1661
|
-
<a name='L1596'></a><a href='#L1596'>1596</a>
|
|
1662
|
-
<a name='L1597'></a><a href='#L1597'>1597</a>
|
|
1663
|
-
<a name='L1598'></a><a href='#L1598'>1598</a>
|
|
1664
|
-
<a name='L1599'></a><a href='#L1599'>1599</a>
|
|
1665
|
-
<a name='L1600'></a><a href='#L1600'>1600</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
1666
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1667
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1668
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1669
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1670
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1671
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1672
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1673
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1674
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1675
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1614
|
+
<a name='L1549'></a><a href='#L1549'>1549</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
1676
1615
|
<span class="cline-any cline-neutral"> </span>
|
|
1677
1616
|
<span class="cline-any cline-neutral"> </span>
|
|
1678
1617
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -1711,7 +1650,6 @@
|
|
|
1711
1650
|
<span class="cline-any cline-neutral"> </span>
|
|
1712
1651
|
<span class="cline-any cline-neutral"> </span>
|
|
1713
1652
|
<span class="cline-any cline-neutral"> </span>
|
|
1714
|
-
<span class="cline-any cline-yes">1x</span>
|
|
1715
1653
|
<span class="cline-any cline-neutral"> </span>
|
|
1716
1654
|
<span class="cline-any cline-neutral"> </span>
|
|
1717
1655
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -2353,23 +2291,15 @@
|
|
|
2353
2291
|
<span class="cline-any cline-neutral"> </span>
|
|
2354
2292
|
<span class="cline-any cline-no"> </span>
|
|
2355
2293
|
<span class="cline-any cline-no"> </span>
|
|
2356
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2357
|
-
<span class="cline-any cline-no"> </span>
|
|
2358
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2359
|
-
<span class="cline-any cline-no"> </span>
|
|
2360
|
-
<span class="cline-any cline-no"> </span>
|
|
2361
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2362
2294
|
<span class="cline-any cline-no"> </span>
|
|
2363
2295
|
<span class="cline-any cline-no"> </span>
|
|
2364
2296
|
<span class="cline-any cline-no"> </span>
|
|
2365
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2366
2297
|
<span class="cline-any cline-no"> </span>
|
|
2367
2298
|
<span class="cline-any cline-no"> </span>
|
|
2368
2299
|
<span class="cline-any cline-no"> </span>
|
|
2369
2300
|
<span class="cline-any cline-no"> </span>
|
|
2370
2301
|
<span class="cline-any cline-neutral"> </span>
|
|
2371
2302
|
<span class="cline-any cline-neutral"> </span>
|
|
2372
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2373
2303
|
<span class="cline-any cline-no"> </span>
|
|
2374
2304
|
<span class="cline-any cline-neutral"> </span>
|
|
2375
2305
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -2409,21 +2339,13 @@
|
|
|
2409
2339
|
<span class="cline-any cline-neutral"> </span>
|
|
2410
2340
|
<span class="cline-any cline-no"> </span>
|
|
2411
2341
|
<span class="cline-any cline-no"> </span>
|
|
2412
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2413
|
-
<span class="cline-any cline-no"> </span>
|
|
2414
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2415
2342
|
<span class="cline-any cline-no"> </span>
|
|
2416
2343
|
<span class="cline-any cline-no"> </span>
|
|
2417
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2418
2344
|
<span class="cline-any cline-no"> </span>
|
|
2419
2345
|
<span class="cline-any cline-no"> </span>
|
|
2420
2346
|
<span class="cline-any cline-no"> </span>
|
|
2421
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2422
2347
|
<span class="cline-any cline-no"> </span>
|
|
2423
2348
|
<span class="cline-any cline-no"> </span>
|
|
2424
|
-
<span class="cline-any cline-no"> </span>
|
|
2425
|
-
<span class="cline-any cline-no"> </span>
|
|
2426
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2427
2349
|
<span class="cline-any cline-neutral"> </span>
|
|
2428
2350
|
<span class="cline-any cline-neutral"> </span>
|
|
2429
2351
|
<span class="cline-any cline-no"> </span>
|
|
@@ -2465,23 +2387,15 @@
|
|
|
2465
2387
|
<span class="cline-any cline-neutral"> </span>
|
|
2466
2388
|
<span class="cline-any cline-no"> </span>
|
|
2467
2389
|
<span class="cline-any cline-no"> </span>
|
|
2468
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2469
|
-
<span class="cline-any cline-no"> </span>
|
|
2470
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2471
|
-
<span class="cline-any cline-no"> </span>
|
|
2472
|
-
<span class="cline-any cline-no"> </span>
|
|
2473
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2474
2390
|
<span class="cline-any cline-no"> </span>
|
|
2475
2391
|
<span class="cline-any cline-no"> </span>
|
|
2476
2392
|
<span class="cline-any cline-no"> </span>
|
|
2477
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2478
2393
|
<span class="cline-any cline-no"> </span>
|
|
2479
2394
|
<span class="cline-any cline-no"> </span>
|
|
2480
2395
|
<span class="cline-any cline-no"> </span>
|
|
2481
2396
|
<span class="cline-any cline-no"> </span>
|
|
2482
2397
|
<span class="cline-any cline-neutral"> </span>
|
|
2483
2398
|
<span class="cline-any cline-neutral"> </span>
|
|
2484
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2485
2399
|
<span class="cline-any cline-no"> </span>
|
|
2486
2400
|
<span class="cline-any cline-neutral"> </span>
|
|
2487
2401
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -2521,23 +2435,15 @@
|
|
|
2521
2435
|
<span class="cline-any cline-neutral"> </span>
|
|
2522
2436
|
<span class="cline-any cline-no"> </span>
|
|
2523
2437
|
<span class="cline-any cline-no"> </span>
|
|
2524
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2525
|
-
<span class="cline-any cline-no"> </span>
|
|
2526
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2527
|
-
<span class="cline-any cline-no"> </span>
|
|
2528
|
-
<span class="cline-any cline-no"> </span>
|
|
2529
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2530
2438
|
<span class="cline-any cline-no"> </span>
|
|
2531
2439
|
<span class="cline-any cline-no"> </span>
|
|
2532
2440
|
<span class="cline-any cline-no"> </span>
|
|
2533
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2534
2441
|
<span class="cline-any cline-no"> </span>
|
|
2535
2442
|
<span class="cline-any cline-no"> </span>
|
|
2536
2443
|
<span class="cline-any cline-no"> </span>
|
|
2537
2444
|
<span class="cline-any cline-no"> </span>
|
|
2538
2445
|
<span class="cline-any cline-neutral"> </span>
|
|
2539
2446
|
<span class="cline-any cline-neutral"> </span>
|
|
2540
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2541
2447
|
<span class="cline-any cline-no"> </span>
|
|
2542
2448
|
<span class="cline-any cline-neutral"> </span>
|
|
2543
2449
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -2799,7 +2705,6 @@
|
|
|
2799
2705
|
<span class="cline-any cline-no"> </span>
|
|
2800
2706
|
<span class="cline-any cline-no"> </span>
|
|
2801
2707
|
<span class="cline-any cline-neutral"> </span>
|
|
2802
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2803
2708
|
<span class="cline-any cline-no"> </span>
|
|
2804
2709
|
<span class="cline-any cline-no"> </span>
|
|
2805
2710
|
<span class="cline-any cline-no"> </span>
|
|
@@ -2847,7 +2752,6 @@
|
|
|
2847
2752
|
<span class="cline-any cline-yes">2x</span>
|
|
2848
2753
|
<span class="cline-any cline-yes">2x</span>
|
|
2849
2754
|
<span class="cline-any cline-neutral"> </span>
|
|
2850
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2851
2755
|
<span class="cline-any cline-yes">2x</span>
|
|
2852
2756
|
<span class="cline-any cline-yes">2x</span>
|
|
2853
2757
|
<span class="cline-any cline-yes">6x</span>
|
|
@@ -2910,7 +2814,6 @@
|
|
|
2910
2814
|
<span class="cline-any cline-yes">3x</span>
|
|
2911
2815
|
<span class="cline-any cline-yes">3x</span>
|
|
2912
2816
|
<span class="cline-any cline-yes">3x</span>
|
|
2913
|
-
<span class="cline-any cline-yes">3x</span>
|
|
2914
2817
|
<span class="cline-any cline-no"> </span>
|
|
2915
2818
|
<span class="cline-any cline-yes">3x</span>
|
|
2916
2819
|
<span class="cline-any cline-yes">3x</span>
|
|
@@ -2992,6 +2895,7 @@
|
|
|
2992
2895
|
<span class="cline-any cline-neutral"> </span>
|
|
2993
2896
|
<span class="cline-any cline-yes">3x</span>
|
|
2994
2897
|
<span class="cline-any cline-yes">3x</span>
|
|
2898
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2995
2899
|
<span class="cline-any cline-yes">3x</span>
|
|
2996
2900
|
<span class="cline-any cline-yes">3x</span>
|
|
2997
2901
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -3042,16 +2946,10 @@
|
|
|
3042
2946
|
<span class="cline-any cline-no"> </span>
|
|
3043
2947
|
<span class="cline-any cline-no"> </span>
|
|
3044
2948
|
<span class="cline-any cline-no"> </span>
|
|
3045
|
-
<span class="cline-any cline-no"> </span>
|
|
3046
|
-
<span class="cline-any cline-no"> </span>
|
|
3047
|
-
<span class="cline-any cline-no"> </span>
|
|
3048
2949
|
<span class="cline-any cline-neutral"> </span>
|
|
3049
|
-
<span class="cline-any cline-no"> </span>
|
|
3050
2950
|
<span class="cline-any cline-neutral"> </span>
|
|
3051
2951
|
<span class="cline-any cline-no"> </span>
|
|
3052
2952
|
<span class="cline-any cline-no"> </span>
|
|
3053
|
-
<span class="cline-any cline-neutral"> </span>
|
|
3054
|
-
<span class="cline-any cline-no"> </span>
|
|
3055
2953
|
<span class="cline-any cline-no"> </span>
|
|
3056
2954
|
<span class="cline-any cline-no"> </span>
|
|
3057
2955
|
<span class="cline-any cline-no"> </span>
|
|
@@ -3069,7 +2967,9 @@
|
|
|
3069
2967
|
<span class="cline-any cline-neutral"> </span>
|
|
3070
2968
|
<span class="cline-any cline-no"> </span>
|
|
3071
2969
|
<span class="cline-any cline-no"> </span>
|
|
2970
|
+
<span class="cline-any cline-neutral"> </span>
|
|
3072
2971
|
<span class="cline-any cline-no"> </span>
|
|
2972
|
+
<span class="cline-any cline-neutral"> </span>
|
|
3073
2973
|
<span class="cline-any cline-no"> </span>
|
|
3074
2974
|
<span class="cline-any cline-no"> </span>
|
|
3075
2975
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -3080,9 +2980,6 @@
|
|
|
3080
2980
|
<span class="cline-any cline-yes">1x</span>
|
|
3081
2981
|
<span class="cline-any cline-no"> </span>
|
|
3082
2982
|
<span class="cline-any cline-no"> </span>
|
|
3083
|
-
<span class="cline-any cline-neutral"> </span>
|
|
3084
|
-
<span class="cline-any cline-neutral"> </span>
|
|
3085
|
-
<span class="cline-any cline-neutral"> </span>
|
|
3086
2983
|
<span class="cline-any cline-no"> </span>
|
|
3087
2984
|
<span class="cline-any cline-no"> </span>
|
|
3088
2985
|
<span class="cline-any cline-no"> </span>
|
|
@@ -3108,7 +3005,6 @@
|
|
|
3108
3005
|
<span class="cline-any cline-no"> </span>
|
|
3109
3006
|
<span class="cline-any cline-no"> </span>
|
|
3110
3007
|
<span class="cline-any cline-no"> </span>
|
|
3111
|
-
<span class="cline-any cline-no"> </span>
|
|
3112
3008
|
<span class="cline-any cline-neutral"> </span>
|
|
3113
3009
|
<span class="cline-any cline-no"> </span>
|
|
3114
3010
|
<span class="cline-any cline-no"> </span>
|
|
@@ -3122,8 +3018,6 @@
|
|
|
3122
3018
|
<span class="cline-any cline-no"> </span>
|
|
3123
3019
|
<span class="cline-any cline-no"> </span>
|
|
3124
3020
|
<span class="cline-any cline-no"> </span>
|
|
3125
|
-
<span class="cline-any cline-no"> </span>
|
|
3126
|
-
<span class="cline-any cline-neutral"> </span>
|
|
3127
3021
|
<span class="cline-any cline-neutral"> </span>
|
|
3128
3022
|
<span class="cline-any cline-neutral"> </span>
|
|
3129
3023
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -3178,6 +3072,9 @@
|
|
|
3178
3072
|
<span class="cline-any cline-neutral"> </span>
|
|
3179
3073
|
<span class="cline-any cline-neutral"> </span>
|
|
3180
3074
|
<span class="cline-any cline-neutral"> </span>
|
|
3075
|
+
<span class="cline-any cline-neutral"> </span>
|
|
3076
|
+
<span class="cline-any cline-neutral"> </span>
|
|
3077
|
+
<span class="cline-any cline-neutral"> </span>
|
|
3181
3078
|
<span class="cline-any cline-no"> </span>
|
|
3182
3079
|
<span class="cline-any cline-no"> </span>
|
|
3183
3080
|
<span class="cline-any cline-no"> </span>
|
|
@@ -3197,6 +3094,7 @@
|
|
|
3197
3094
|
<span class="cline-any cline-neutral"> </span>
|
|
3198
3095
|
<span class="cline-any cline-no"> </span>
|
|
3199
3096
|
<span class="cline-any cline-no"> </span>
|
|
3097
|
+
<span class="cline-any cline-neutral"> </span>
|
|
3200
3098
|
<span class="cline-any cline-no"> </span>
|
|
3201
3099
|
<span class="cline-any cline-no"> </span>
|
|
3202
3100
|
<span class="cline-any cline-no"> </span>
|
|
@@ -3261,17 +3159,7 @@
|
|
|
3261
3159
|
<span class="cline-any cline-neutral"> </span>
|
|
3262
3160
|
<span class="cline-any cline-neutral"> </span>
|
|
3263
3161
|
<span class="cline-any cline-neutral"> </span>
|
|
3264
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {
|
|
3265
|
-
import {
|
|
3266
|
-
TranslatorState,
|
|
3267
|
-
shiftState,
|
|
3268
|
-
withSourceMap,
|
|
3269
|
-
indent,
|
|
3270
|
-
createCompilerState,
|
|
3271
|
-
withSourceMapGenerator,
|
|
3272
|
-
withGenerator,
|
|
3273
|
-
TranslatorGenerator,
|
|
3274
|
-
} from '../translator';
|
|
3162
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3275
3163
|
import { ElementToVueOptions } from './ViewElement__';
|
|
3276
3164
|
import MemberExpression from './MemberExpression__';
|
|
3277
3165
|
import StructureProperty from './StructureProperty__';
|
|
@@ -3308,7 +3196,6 @@ export class NewComposite extends LogicItem {
|
|
|
3308
3196
|
/**
|
|
3309
3197
|
* 产品概念
|
|
3310
3198
|
*/
|
|
3311
|
-
@property('concept')
|
|
3312
3199
|
// @ts-ignore
|
|
3313
3200
|
readonly concept!: 'NewComposite';
|
|
3314
3201
|
|
|
@@ -3457,7 +3344,7 @@ export class NewComposite extends LogicItem {
|
|
|
3457
3344
|
|
|
3458
3345
|
<span class="fstat-no" title="function not covered" > getIdentifierExistingNames(</span>excludedList: Array<Identifier> = <span class="branch-0 cbranch-no" title="branch not covered" >[])</span> {
|
|
3459
3346
|
const excludedSet = <span class="cstat-no" title="statement not covered" >new Set(excludedList);</span>
|
|
3460
|
-
<span class="cstat-no" title="statement not covered" > return ((this.properties as Identifier[]) || []).filter(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >!excludedSet.has(item))</span>.map(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >item
|
|
3347
|
+
<span class="cstat-no" title="statement not covered" > return ((this.properties as Identifier[]) || []).filter(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >!excludedSet.has(item))</span>.map(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >item.name)</span>;</span>
|
|
3461
3348
|
}
|
|
3462
3349
|
<span class="fstat-no" title="function not covered" > getIdentifierUniqueName(</span>name = <span class="branch-0 cbranch-no" title="branch not covered" >'identifier1')</span> {
|
|
3463
3350
|
<span class="cstat-no" title="statement not covered" > return utils.unique(name, this.getIdentifierExistingNames(), undefined, false);</span>
|
|
@@ -3610,7 +3497,7 @@ export class NewComposite extends LogicItem {
|
|
|
3610
3497
|
|
|
3611
3498
|
<span class="fstat-no" title="function not covered" > getSelectMembersExistingNames(</span>excludedList: Array<SelectMembers> = <span class="branch-0 cbranch-no" title="branch not covered" >[])</span> {
|
|
3612
3499
|
const excludedSet = <span class="cstat-no" title="statement not covered" >new Set(excludedList);</span>
|
|
3613
|
-
<span class="cstat-no" title="statement not covered" > return ((this.rights as SelectMembers[]) || []).filter(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >!excludedSet.has(item))</span>.map(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >item
|
|
3500
|
+
<span class="cstat-no" title="statement not covered" > return ((this.rights as SelectMembers[]) || []).filter(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >!excludedSet.has(item))</span>.map(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >item.name)</span>;</span>
|
|
3614
3501
|
}
|
|
3615
3502
|
<span class="fstat-no" title="function not covered" > getSelectMembersUniqueName(</span>name = <span class="branch-0 cbranch-no" title="branch not covered" >'selectMembers1')</span> {
|
|
3616
3503
|
<span class="cstat-no" title="statement not covered" > return utils.unique(name, this.getSelectMembersExistingNames(), undefined, false);</span>
|
|
@@ -3765,7 +3652,7 @@ export class NewComposite extends LogicItem {
|
|
|
3765
3652
|
const excludedSet = <span class="cstat-no" title="statement not covered" >new Set(excludedList);</span>
|
|
3766
3653
|
<span class="cstat-no" title="statement not covered" > return ((this.assignmentLines as AssignmentLine[]) || [])</span>
|
|
3767
3654
|
.filter(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >!excludedSet.has(item))</span>
|
|
3768
|
-
.map(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >item
|
|
3655
|
+
.map(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >item.name)</span>;
|
|
3769
3656
|
}
|
|
3770
3657
|
<span class="fstat-no" title="function not covered" > getAssignmentLineUniqueName(</span>name = <span class="branch-0 cbranch-no" title="branch not covered" >'assignmentLine1')</span> {
|
|
3771
3658
|
<span class="cstat-no" title="statement not covered" > return utils.unique(name, this.getAssignmentLineExistingNames(), undefined, false);</span>
|
|
@@ -3952,21 +3839,13 @@ export class NewComposite extends LogicItem {
|
|
|
3952
3839
|
};
|
|
3953
3840
|
<span class="cstat-no" title="statement not covered" > if (parentKey) {</span>
|
|
3954
3841
|
<span class="cstat-no" title="statement not covered" > params.parentKey = parentKey;</span>
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
// @ts-ignore
|
|
3958
|
-
const n = <span class="cstat-no" title="statement not covered" >typeAnnotation.__v_raw || typeAnnotation;</span>
|
|
3959
|
-
<span class="cstat-no" title="statement not covered" > if (Array.isArray((t as any)[parentKey])) {</span>
|
|
3960
|
-
// @ts-ignore
|
|
3961
|
-
const index = (<span class="cstat-no" title="statement not covered" >t as any)[parentKey].findIndex(<span class="fstat-no" title="function not covered" >(e</span>l) => <span class="cstat-no" title="statement not covered" >(el.__v_raw || el) === n)</span>;</span>
|
|
3842
|
+
<span class="cstat-no" title="statement not covered" > if (Array.isArray((this as any)[parentKey])) {</span>
|
|
3843
|
+
const index = (<span class="cstat-no" title="statement not covered" >this as any)[parentKey].indexOf(typeAnnotation);</span>
|
|
3962
3844
|
<span class="cstat-no" title="statement not covered" > ~index && (this as any)[parentKey].splice(index, 1);</span>
|
|
3963
3845
|
<span class="cstat-no" title="statement not covered" > params.index = index;</span>
|
|
3964
|
-
} else {
|
|
3965
|
-
|
|
3966
|
-
<span class="cstat-no" title="statement not covered" >
|
|
3967
|
-
<span class="cstat-no" title="statement not covered" > params.index = 0;</span>
|
|
3968
|
-
(<span class="cstat-no" title="statement not covered" >this as any)[parentKey] = undefined;</span>
|
|
3969
|
-
}
|
|
3846
|
+
} else <span class="cstat-no" title="statement not covered" >if ((this as any)[parentKey] === typeAnnotation) {</span>
|
|
3847
|
+
<span class="cstat-no" title="statement not covered" > params.index = 0;</span>
|
|
3848
|
+
(<span class="cstat-no" title="statement not covered" >this as any)[parentKey] = undefined;</span>
|
|
3970
3849
|
}
|
|
3971
3850
|
}
|
|
3972
3851
|
<span class="cstat-no" title="statement not covered" > return params;</span>
|
|
@@ -4008,21 +3887,13 @@ export class NewComposite extends LogicItem {
|
|
|
4008
3887
|
};
|
|
4009
3888
|
<span class="cstat-no" title="statement not covered" > if (parentKey) {</span>
|
|
4010
3889
|
<span class="cstat-no" title="statement not covered" > params.parentKey = parentKey;</span>
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
// @ts-ignore
|
|
4014
|
-
const n = <span class="cstat-no" title="statement not covered" >logicItem.__v_raw || logicItem;</span>
|
|
4015
|
-
<span class="cstat-no" title="statement not covered" > if (Array.isArray((t as any)[parentKey])) {</span>
|
|
4016
|
-
// @ts-ignore
|
|
4017
|
-
const index = (<span class="cstat-no" title="statement not covered" >t as any)[parentKey].findIndex(<span class="fstat-no" title="function not covered" >(e</span>l) => <span class="cstat-no" title="statement not covered" >(el.__v_raw || el) === n)</span>;</span>
|
|
3890
|
+
<span class="cstat-no" title="statement not covered" > if (Array.isArray((this as any)[parentKey])) {</span>
|
|
3891
|
+
const index = (<span class="cstat-no" title="statement not covered" >this as any)[parentKey].indexOf(logicItem);</span>
|
|
4018
3892
|
<span class="cstat-no" title="statement not covered" > ~index && (this as any)[parentKey].splice(index, 1);</span>
|
|
4019
3893
|
<span class="cstat-no" title="statement not covered" > params.index = index;</span>
|
|
4020
|
-
} else {
|
|
4021
|
-
|
|
4022
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4023
|
-
<span class="cstat-no" title="statement not covered" > params.index = 0;</span>
|
|
4024
|
-
(<span class="cstat-no" title="statement not covered" >this as any)[parentKey] = undefined;</span>
|
|
4025
|
-
}
|
|
3894
|
+
} else <span class="cstat-no" title="statement not covered" >if ((this as any)[parentKey] === logicItem) {</span>
|
|
3895
|
+
<span class="cstat-no" title="statement not covered" > params.index = 0;</span>
|
|
3896
|
+
(<span class="cstat-no" title="statement not covered" >this as any)[parentKey] = undefined;</span>
|
|
4026
3897
|
}
|
|
4027
3898
|
}
|
|
4028
3899
|
<span class="cstat-no" title="statement not covered" > return params;</span>
|
|
@@ -4064,21 +3935,13 @@ export class NewComposite extends LogicItem {
|
|
|
4064
3935
|
};
|
|
4065
3936
|
<span class="cstat-no" title="statement not covered" > if (parentKey) {</span>
|
|
4066
3937
|
<span class="cstat-no" title="statement not covered" > params.parentKey = parentKey;</span>
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
// @ts-ignore
|
|
4070
|
-
const n = <span class="cstat-no" title="statement not covered" >selectMembers.__v_raw || selectMembers;</span>
|
|
4071
|
-
<span class="cstat-no" title="statement not covered" > if (Array.isArray((t as any)[parentKey])) {</span>
|
|
4072
|
-
// @ts-ignore
|
|
4073
|
-
const index = (<span class="cstat-no" title="statement not covered" >t as any)[parentKey].findIndex(<span class="fstat-no" title="function not covered" >(e</span>l) => <span class="cstat-no" title="statement not covered" >(el.__v_raw || el) === n)</span>;</span>
|
|
3938
|
+
<span class="cstat-no" title="statement not covered" > if (Array.isArray((this as any)[parentKey])) {</span>
|
|
3939
|
+
const index = (<span class="cstat-no" title="statement not covered" >this as any)[parentKey].indexOf(selectMembers);</span>
|
|
4074
3940
|
<span class="cstat-no" title="statement not covered" > ~index && (this as any)[parentKey].splice(index, 1);</span>
|
|
4075
3941
|
<span class="cstat-no" title="statement not covered" > params.index = index;</span>
|
|
4076
|
-
} else {
|
|
4077
|
-
|
|
4078
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4079
|
-
<span class="cstat-no" title="statement not covered" > params.index = 0;</span>
|
|
4080
|
-
(<span class="cstat-no" title="statement not covered" >this as any)[parentKey] = undefined;</span>
|
|
4081
|
-
}
|
|
3942
|
+
} else <span class="cstat-no" title="statement not covered" >if ((this as any)[parentKey] === selectMembers) {</span>
|
|
3943
|
+
<span class="cstat-no" title="statement not covered" > params.index = 0;</span>
|
|
3944
|
+
(<span class="cstat-no" title="statement not covered" >this as any)[parentKey] = undefined;</span>
|
|
4082
3945
|
}
|
|
4083
3946
|
}
|
|
4084
3947
|
<span class="cstat-no" title="statement not covered" > return params;</span>
|
|
@@ -4120,21 +3983,13 @@ export class NewComposite extends LogicItem {
|
|
|
4120
3983
|
};
|
|
4121
3984
|
<span class="cstat-no" title="statement not covered" > if (parentKey) {</span>
|
|
4122
3985
|
<span class="cstat-no" title="statement not covered" > params.parentKey = parentKey;</span>
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
// @ts-ignore
|
|
4126
|
-
const n = <span class="cstat-no" title="statement not covered" >assignmentLine.__v_raw || assignmentLine;</span>
|
|
4127
|
-
<span class="cstat-no" title="statement not covered" > if (Array.isArray((t as any)[parentKey])) {</span>
|
|
4128
|
-
// @ts-ignore
|
|
4129
|
-
const index = (<span class="cstat-no" title="statement not covered" >t as any)[parentKey].findIndex(<span class="fstat-no" title="function not covered" >(e</span>l) => <span class="cstat-no" title="statement not covered" >(el.__v_raw || el) === n)</span>;</span>
|
|
3986
|
+
<span class="cstat-no" title="statement not covered" > if (Array.isArray((this as any)[parentKey])) {</span>
|
|
3987
|
+
const index = (<span class="cstat-no" title="statement not covered" >this as any)[parentKey].indexOf(assignmentLine);</span>
|
|
4130
3988
|
<span class="cstat-no" title="statement not covered" > ~index && (this as any)[parentKey].splice(index, 1);</span>
|
|
4131
3989
|
<span class="cstat-no" title="statement not covered" > params.index = index;</span>
|
|
4132
|
-
} else {
|
|
4133
|
-
|
|
4134
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4135
|
-
<span class="cstat-no" title="statement not covered" > params.index = 0;</span>
|
|
4136
|
-
(<span class="cstat-no" title="statement not covered" >this as any)[parentKey] = undefined;</span>
|
|
4137
|
-
}
|
|
3990
|
+
} else <span class="cstat-no" title="statement not covered" >if ((this as any)[parentKey] === assignmentLine) {</span>
|
|
3991
|
+
<span class="cstat-no" title="statement not covered" > params.index = 0;</span>
|
|
3992
|
+
(<span class="cstat-no" title="statement not covered" >this as any)[parentKey] = undefined;</span>
|
|
4138
3993
|
}
|
|
4139
3994
|
}
|
|
4140
3995
|
<span class="cstat-no" title="statement not covered" > return params;</span>
|
|
@@ -4198,7 +4053,7 @@ export class NewComposite extends LogicItem {
|
|
|
4198
4053
|
}
|
|
4199
4054
|
<span class="cstat-no" title="statement not covered" > members.forEach(<span class="fstat-no" title="function not covered" >(r</span>ightMember: any, rightSecondIndex: number) => {</span>
|
|
4200
4055
|
const rightName = <span class="cstat-no" title="statement not covered" >rightMember.property.name;</span>
|
|
4201
|
-
<span class="cstat-no" title="statement not covered" > if (rightLineSet.has(rightSecondIndex)
|
|
4056
|
+
<span class="cstat-no" title="statement not covered" > if (rightLineSet.has(rightSecondIndex)) <span class="cstat-no" title="statement not covered" >return;</span></span>
|
|
4202
4057
|
|
|
4203
4058
|
<span class="cstat-no" title="statement not covered" > if (leftName === rightName) {</span>
|
|
4204
4059
|
const rightTypeAnnotation = <span class="cstat-no" title="statement not covered" >rightMember.__TypeAnnotation;</span>
|
|
@@ -4316,7 +4171,7 @@ export class NewComposite extends LogicItem {
|
|
|
4316
4171
|
});
|
|
4317
4172
|
const selectMember = <span class="cstat-no" title="statement not covered" >oldNode.parentNode;</span>
|
|
4318
4173
|
const autoConnectionIndex = <span class="cstat-no" title="statement not covered" >this.rights.findIndex(<span class="fstat-no" title="function not covered" >(r</span>ight) => <span class="cstat-no" title="statement not covered" >right === selectMember)</span>;</span>
|
|
4319
|
-
const newSelectMember = <span class="cstat-no" title="statement not covered" >{ ...
|
|
4174
|
+
const newSelectMember = <span class="cstat-no" title="statement not covered" >{ ...selectMember?.toJSON?.() ?? selectMember, expression, members };</span>
|
|
4320
4175
|
const splitIndex = <span class="cstat-no" title="statement not covered" >this.rights.findIndex(<span class="fstat-no" title="function not covered" >(r</span>ight) => <span class="cstat-no" title="statement not covered" >selectMember === right)</span>;</span>
|
|
4321
4176
|
const newLines: AssignmentLine[] = <span class="cstat-no" title="statement not covered" >this.assignmentLines.filter(<span class="fstat-no" title="function not covered" >({</span> rightIndex }) => <span class="cstat-no" title="statement not covered" >rightIndex[0] !== splitIndex)</span>;</span>
|
|
4322
4177
|
let oldLines: AssignmentLine[] = <span class="cstat-no" title="statement not covered" >this.assignmentLines.filter(<span class="fstat-no" title="function not covered" >({</span> rightIndex }) => <span class="cstat-no" title="statement not covered" >rightIndex[0] === splitIndex)</span>;</span>
|
|
@@ -4325,7 +4180,7 @@ export class NewComposite extends LogicItem {
|
|
|
4325
4180
|
<span class="cstat-no" title="statement not covered" > if (keepMembers?.has(item.completeName)) {</span>
|
|
4326
4181
|
const lines = <span class="cstat-no" title="statement not covered" >this.findlines(item, selectMember);</span>
|
|
4327
4182
|
<span class="cstat-no" title="statement not covered" > lines.forEach(<span class="fstat-no" title="function not covered" >(l</span>ine) => {</span>
|
|
4328
|
-
const newLine = <span class="cstat-no" title="statement not covered" >{ ...
|
|
4183
|
+
const newLine = <span class="cstat-no" title="statement not covered" >{ ...line?.toJSON()?.toJSON?.() ?? line, rightIndex: [line.rightIndex[0], index] };</span>
|
|
4329
4184
|
<span class="cstat-no" title="statement not covered" > newLines.push(newLine as AssignmentLine);</span>
|
|
4330
4185
|
<span class="cstat-no" title="statement not covered" > oldLines = oldLines.filter(<span class="fstat-no" title="function not covered" >({</span> leftIndex }) => <span class="cstat-no" title="statement not covered" >leftIndex[1] !== line.leftIndex[1])</span>;</span>
|
|
4331
4186
|
});
|
|
@@ -4396,9 +4251,8 @@ export class NewComposite extends LogicItem {
|
|
|
4396
4251
|
: this.rights[rightIndex[0]].expression;
|
|
4397
4252
|
<span class="cstat-no" title="statement not covered" > code += `return ${obj};\n`;</span>
|
|
4398
4253
|
} else <span class="cstat-no" title="statement not covered" >if (typeAnnotation.typeKind !== 'anonymousStructure') {</span>
|
|
4399
|
-
<span class="cstat-no" title="statement not covered" > code += `const obj = this.$genInitFromSchema('${</span>
|
|
4400
|
-
typeAnnotation.
|
|
4401
|
-
}', this.$utils['New'](${typeAnnotation.toUI(shiftState(state, code, { inline: true }))}));\n`;
|
|
4254
|
+
<span class="cstat-no" title="statement not covered" > code += `const obj = this.$genInitFromSchema('${typeAnnotation.sortedTypeKey</span>
|
|
4255
|
+
}', this.$utils['New'](${typeAnnotation.toUI(shiftState(state, code, { inline: true }))}));\n`;
|
|
4402
4256
|
<span class="cstat-no" title="statement not covered" > this.assignmentLines.forEach(<span class="fstat-no" title="function not covered" >({</span> leftIndex, rightIndex }, index) => {</span>
|
|
4403
4257
|
const leftSecondIndex = <span class="cstat-no" title="statement not covered" >leftIndex[1];</span>
|
|
4404
4258
|
const [rightFirst, rightSecond] = <span class="cstat-no" title="statement not covered" >[rightIndex[0], rightIndex[1]];</span>
|
|
@@ -4444,9 +4298,8 @@ export class NewComposite extends LogicItem {
|
|
|
4444
4298
|
: this.rights[rightIndex[0]].expression;
|
|
4445
4299
|
<span class="cstat-no" title="statement not covered" > code += `return ${obj.toJS(shiftState(state, code, { inline: true }))};\n`;</span>
|
|
4446
4300
|
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (typeAnnotation.typeKind !== 'anonymousStructure') {
|
|
4447
|
-
code += `const obj = this.$genInitFromSchema('${
|
|
4448
|
-
typeAnnotation.
|
|
4449
|
-
}', this.$utils['New'](${typeAnnotation.toJS(shiftState(state, code, { inline: true }))}));\n`;
|
|
4301
|
+
code += `const obj = this.$genInitFromSchema('${typeAnnotation.sortedTypeKey
|
|
4302
|
+
}', this.$utils['New'](${typeAnnotation.toJS(shiftState(state, code, { inline: true }))}));\n`;
|
|
4450
4303
|
const rightMap = new Map();
|
|
4451
4304
|
this.assignmentLines.forEach(({ leftIndex, rightIndex }) => {
|
|
4452
4305
|
const rightIndexJson = JSON.stringify(rightIndex);
|
|
@@ -4501,30 +4354,29 @@ export class NewComposite extends LogicItem {
|
|
|
4501
4354
|
return code;
|
|
4502
4355
|
}
|
|
4503
4356
|
|
|
4504
|
-
@
|
|
4505
|
-
|
|
4506
|
-
const self = this;
|
|
4357
|
+
@withSourceMap()
|
|
4358
|
+
toEmbeddedTS(state = <span class="branch-0 cbranch-no" title="branch not covered" >createCompilerState())</span>: string {
|
|
4507
4359
|
const indent0 = indent(state?.tabSize || 0);
|
|
4508
4360
|
const indent1 = indent((state?.tabSize || 0) + 1);
|
|
4509
4361
|
const indent2 = indent((state?.tabSize || 0) + 2);
|
|
4510
4362
|
const indent3 = indent((state?.tabSize || 0) + 3);
|
|
4511
4363
|
let code = '';
|
|
4512
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (!
|
|
4364
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (!this.typeAnnotation) {
|
|
4513
4365
|
<span class="cstat-no" title="statement not covered" > code += '__IDENTIFIER__';</span>
|
|
4514
|
-
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (
|
|
4366
|
+
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (this.typeAnnotation.typeKind !== 'anonymousStructure') {
|
|
4515
4367
|
const rightMap = new Map();
|
|
4516
4368
|
code += `${indent0}(() => { \n`;
|
|
4517
4369
|
// 提供sourcemap,获取类型标注和上下文可选变量
|
|
4518
|
-
|
|
4370
|
+
this.rights.forEach((right) => {
|
|
4519
4371
|
code += indent1;
|
|
4520
|
-
rightMap.set(right.expression,
|
|
4372
|
+
rightMap.set(right.expression, right.expression.toEmbeddedTS(shiftState(state, code, { inline: true })));
|
|
4521
4373
|
code += rightMap.get(right.expression);
|
|
4522
4374
|
code += ';\n';
|
|
4523
4375
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (right.members?.length) {
|
|
4524
4376
|
<span class="cstat-no" title="statement not covered" > code += indent2;</span>
|
|
4525
4377
|
}
|
|
4526
|
-
|
|
4527
|
-
<span class="cstat-no" title="statement not covered" > rightMap.set(member,
|
|
4378
|
+
right.members.forEach(<span class="fstat-no" title="function not covered" >(m</span>ember) => {
|
|
4379
|
+
<span class="cstat-no" title="statement not covered" > rightMap.set(member, member.toEmbeddedTS(shiftState(state, code, { inline: true })));</span>
|
|
4528
4380
|
<span class="cstat-no" title="statement not covered" > code += rightMap.get(member);</span>
|
|
4529
4381
|
<span class="cstat-no" title="statement not covered" > code += '; ';</span>
|
|
4530
4382
|
});
|
|
@@ -4532,92 +4384,93 @@ export class NewComposite extends LogicItem {
|
|
|
4532
4384
|
});
|
|
4533
4385
|
// 方便ts报错检查
|
|
4534
4386
|
code += `${indent1}function __newComposite() {\n`;
|
|
4535
|
-
const { typeAnnotation } =
|
|
4387
|
+
const { typeAnnotation } = this;
|
|
4536
4388
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (
|
|
4537
4389
|
['nasl.ui', 'nasl.interface', 'nasl.http'].includes(typeAnnotation.typeNamespace) &&
|
|
4538
4390
|
<span class="branch-1 cbranch-no" title="branch not covered" > typeAnnotation.typeKind === 'generic'</span>
|
|
4539
4391
|
) {
|
|
4540
4392
|
<span class="cstat-no" title="statement not covered" > code += `${indent2}let __obj = new ${typeAnnotation.typeNamespace}.${typeAnnotation.typeName}`;</span>
|
|
4541
4393
|
<span class="cstat-no" title="statement not covered" > code += '({';</span>
|
|
4542
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4394
|
+
<span class="cstat-no" title="statement not covered" > this.assignmentLines.forEach(<span class="fstat-no" title="function not covered" >({</span> leftIndex, rightIndex }) => {</span>
|
|
4543
4395
|
const leftSecondIndex = <span class="cstat-no" title="statement not covered" >leftIndex[1];</span>
|
|
4544
4396
|
const [rightFirst, rightSecond] = <span class="cstat-no" title="statement not covered" >[rightIndex[0], rightIndex[1]];</span>
|
|
4545
|
-
const leftItem = <span class="cstat-no" title="statement not covered" >
|
|
4397
|
+
const leftItem = <span class="cstat-no" title="statement not covered" >this.properties[leftSecondIndex];</span>
|
|
4546
4398
|
const rightItem =
|
|
4547
4399
|
<span class="cstat-no" title="statement not covered" > rightSecond !== undefined</span>
|
|
4548
|
-
?
|
|
4549
|
-
:
|
|
4400
|
+
? this.rights[rightFirst].members[rightSecond]
|
|
4401
|
+
: this.rights[rightFirst].expression;
|
|
4550
4402
|
const rightTs = <span class="cstat-no" title="statement not covered" >rightMap.get(rightItem);</span>
|
|
4551
|
-
<span class="cstat-no" title="statement not covered" > code += `${
|
|
4403
|
+
<span class="cstat-no" title="statement not covered" > code += `${leftItem.toEmbeddedTS(shiftState(state, code, { inline: true }))}:`;</span>
|
|
4552
4404
|
<span class="cstat-no" title="statement not covered" > code += `${['__IDENTIFIER__', '__IDENTIFIER__()'].includes(rightTs) ? 'null' : rightMap.get(rightItem)},\n `;</span>
|
|
4553
4405
|
});
|
|
4554
4406
|
<span class="cstat-no" title="statement not covered" > code += '})\n';</span>
|
|
4555
4407
|
} else {
|
|
4556
4408
|
code += `${indent2}let __obj = nasl.util.New<`;
|
|
4557
|
-
code +=
|
|
4409
|
+
code += this.typeAnnotation.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
4558
4410
|
code += `>();\n`;
|
|
4559
4411
|
}
|
|
4560
4412
|
// 是否是左边的顶层连线
|
|
4561
|
-
const leftTopIndex =
|
|
4413
|
+
const leftTopIndex = this.assignmentLines.findIndex(({ leftIndex }) => leftIndex[1] === undefined);
|
|
4562
4414
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (leftTopIndex !== -1) {
|
|
4563
|
-
const { rightIndex } = <span class="cstat-no" title="statement not covered" >
|
|
4415
|
+
const { rightIndex } = <span class="cstat-no" title="statement not covered" >this.assignmentLines[leftTopIndex];</span>
|
|
4564
4416
|
const rightExpression =
|
|
4565
4417
|
<span class="cstat-no" title="statement not covered" > rightIndex[1] !== undefined</span>
|
|
4566
|
-
?
|
|
4567
|
-
:
|
|
4568
|
-
<span class="cstat-no" title="statement not covered" > code += `__obj = ${
|
|
4418
|
+
? this.rights[rightIndex[0]].members[rightIndex[1]]
|
|
4419
|
+
: this.rights[rightIndex[0]].expression;
|
|
4420
|
+
<span class="cstat-no" title="statement not covered" > code += `__obj = ${rightExpression.toEmbeddedTS(shiftState(state, code, { inline: true }))};`;</span>
|
|
4569
4421
|
<span class="cstat-no" title="statement not covered" > code += '\n';</span>
|
|
4570
4422
|
} else {
|
|
4571
4423
|
// 左侧properties的identifier的类型标注
|
|
4572
4424
|
code += `${indent2}const { `;
|
|
4573
|
-
|
|
4574
|
-
code +=
|
|
4575
|
-
if (index <
|
|
4425
|
+
this.properties.forEach((item, index) => {
|
|
4426
|
+
code += item.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
4427
|
+
if (index < this.properties.length - 1) code += ', ';
|
|
4576
4428
|
});
|
|
4577
4429
|
code += ' } = __obj;\n';
|
|
4578
|
-
|
|
4430
|
+
this.assignmentLines.forEach(({ leftIndex, rightIndex }) => {
|
|
4579
4431
|
const leftSecondIndex = leftIndex[1];
|
|
4580
4432
|
const [rightFirst, rightSecond] = [rightIndex[0], rightIndex[1]];
|
|
4581
|
-
const leftItem =
|
|
4433
|
+
const leftItem = this.properties[leftSecondIndex];
|
|
4582
4434
|
const rightItem =
|
|
4583
4435
|
rightSecond !== undefined
|
|
4584
|
-
? <span class="branch-0 cbranch-no" title="branch not covered" >
|
|
4585
|
-
:
|
|
4436
|
+
? <span class="branch-0 cbranch-no" title="branch not covered" >this.rights[rightFirst].members[rightSecond]</span>
|
|
4437
|
+
: this.rights[rightFirst].expression;
|
|
4586
4438
|
const rightTs = rightMap.get(rightItem);
|
|
4587
4439
|
code += `${indent2}nasl.core.compareNew(`;
|
|
4588
4440
|
code += `${['__IDENTIFIER__', '__IDENTIFIER__()'].includes(rightTs) ? <span class="branch-0 cbranch-no" title="branch not covered" >'null' </span>: rightMap.get(rightItem)}, `;
|
|
4589
|
-
code += `${
|
|
4441
|
+
code += `${leftItem.toEmbeddedTS(shiftState(state, code, { inline: true }))});\n`;
|
|
4590
4442
|
});
|
|
4591
4443
|
}
|
|
4592
4444
|
code += `${indent2}return __obj;\n`;
|
|
4593
4445
|
code += `${indent1}};\n`;
|
|
4446
|
+
|
|
4594
4447
|
code += `${indent1}return __newComposite();\n`;
|
|
4595
4448
|
code += `${indent0}})()`;
|
|
4596
4449
|
} else {
|
|
4597
4450
|
const nameMap = <span class="cstat-no" title="statement not covered" >new Map();</span>
|
|
4598
4451
|
const rightMap = <span class="cstat-no" title="statement not covered" >new Map();</span>
|
|
4599
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4452
|
+
<span class="cstat-no" title="statement not covered" > this.assignmentLines.forEach(<span class="fstat-no" title="function not covered" >({</span> leftIndex, rightIndex }) => {</span>
|
|
4600
4453
|
const leftSecondIndex = <span class="cstat-no" title="statement not covered" >leftIndex[1];</span>
|
|
4601
4454
|
const [rightFirst, rightSecond] = <span class="cstat-no" title="statement not covered" >[rightIndex[0], rightIndex[1]];</span>
|
|
4602
|
-
const leftItem = <span class="cstat-no" title="statement not covered" >
|
|
4455
|
+
const leftItem = <span class="cstat-no" title="statement not covered" >this.properties[leftSecondIndex];</span>
|
|
4603
4456
|
const rightItem =
|
|
4604
|
-
<span class="cstat-no" title="statement not covered" > rightSecond !== undefined ?
|
|
4457
|
+
<span class="cstat-no" title="statement not covered" > rightSecond !== undefined ? this.rights[rightFirst].members[rightSecond] : this.rights[rightFirst].expression;</span>
|
|
4605
4458
|
<span class="cstat-no" title="statement not covered" > nameMap.set(leftItem.name, rightItem);</span>
|
|
4606
4459
|
<span class="cstat-no" title="statement not covered" > rightMap.set(rightItem, null);</span>
|
|
4607
4460
|
});
|
|
4608
4461
|
<span class="cstat-no" title="statement not covered" > code += `${indent0}(() => { \n`;</span>
|
|
4609
4462
|
// 提供sourcemap,获取类型标注和上下文可选变量
|
|
4610
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4463
|
+
<span class="cstat-no" title="statement not covered" > this.rights.forEach(<span class="fstat-no" title="function not covered" >(r</span>ight) => {</span>
|
|
4611
4464
|
<span class="cstat-no" title="statement not covered" > code += indent1;</span>
|
|
4612
|
-
let ts = <span class="cstat-no" title="statement not covered" >
|
|
4465
|
+
let ts = <span class="cstat-no" title="statement not covered" >right.expression.toEmbeddedTS(shiftState(state, code, { inline: true }));</span>
|
|
4613
4466
|
<span class="cstat-no" title="statement not covered" > if (rightMap.has(right.expression)) <span class="cstat-no" title="statement not covered" >rightMap.set(right.expression, ts);</span></span>
|
|
4614
4467
|
<span class="cstat-no" title="statement not covered" > code += ts;</span>
|
|
4615
4468
|
<span class="cstat-no" title="statement not covered" > code += ';\n';</span>
|
|
4616
4469
|
<span class="cstat-no" title="statement not covered" > if (right.members?.length) {</span>
|
|
4617
4470
|
<span class="cstat-no" title="statement not covered" > code += indent2;</span>
|
|
4618
4471
|
}
|
|
4619
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4620
|
-
<span class="cstat-no" title="statement not covered" > ts =
|
|
4472
|
+
<span class="cstat-no" title="statement not covered" > right.members.forEach(<span class="fstat-no" title="function not covered" >(m</span>ember) => {</span>
|
|
4473
|
+
<span class="cstat-no" title="statement not covered" > ts = member.toEmbeddedTS(shiftState(state, code, { inline: true }));</span>
|
|
4621
4474
|
<span class="cstat-no" title="statement not covered" > if (rightMap.has(member)) <span class="cstat-no" title="statement not covered" >rightMap.set(member, ts);</span></span>
|
|
4622
4475
|
<span class="cstat-no" title="statement not covered" > code += ts;</span>
|
|
4623
4476
|
<span class="cstat-no" title="statement not covered" > code += '; ';</span>
|
|
@@ -4626,9 +4479,9 @@ export class NewComposite extends LogicItem {
|
|
|
4626
4479
|
});
|
|
4627
4480
|
// 方便ts报错检查
|
|
4628
4481
|
<span class="cstat-no" title="statement not covered" > code += `${indent1}function __newComposite() {\n`;</span>
|
|
4629
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4482
|
+
<span class="cstat-no" title="statement not covered" > this.properties.forEach(<span class="fstat-no" title="function not covered" >(p</span>roperty, index) => {</span>
|
|
4630
4483
|
const temp = <span class="cstat-no" title="statement not covered" >`temp${index}`;</span>
|
|
4631
|
-
const propertyType = <span class="cstat-no" title="statement not covered" >
|
|
4484
|
+
const propertyType = <span class="cstat-no" title="statement not covered" >this.typeAnnotation.properties[index]?.typeAnnotation;</span>
|
|
4632
4485
|
const { name } = <span class="cstat-no" title="statement not covered" >property;</span>
|
|
4633
4486
|
const rightItem = <span class="cstat-no" title="statement not covered" >nameMap.get(name);</span>
|
|
4634
4487
|
const ts = <span class="cstat-no" title="statement not covered" >rightMap.get(rightItem);</span>
|
|
@@ -4638,37 +4491,33 @@ export class NewComposite extends LogicItem {
|
|
|
4638
4491
|
} else {
|
|
4639
4492
|
<span class="cstat-no" title="statement not covered" > code += `${indent2}let ${temp}${ts === 'null' ? ':void' : ''} = ${ts}; `;</span>
|
|
4640
4493
|
}
|
|
4641
|
-
<span class="cstat-no" title="statement not covered" > code += `
|
|
4642
|
-
<span class="cstat-no" title="statement not covered" > code += `${
|
|
4643
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4647
|
-
// 如果是字段是union类型,且赋值的是当前union允许的类型,会导致property.name类型推断成temp的类型
|
|
4648
|
-
<span class="cstat-no" title="statement not covered" > code += `${indent2}${property.name} = ${property.name} as ${typeTs};\n`;</span>
|
|
4649
|
-
} else {
|
|
4650
|
-
<span class="cstat-no" title="statement not covered" > code += `nasl.core.Incompatible<typeof ${temp}, void>`;</span>
|
|
4651
|
-
<span class="cstat-no" title="statement not covered" > code += ` = ${temp};\n`;</span>
|
|
4652
|
-
}
|
|
4494
|
+
<span class="cstat-no" title="statement not covered" > code += `const `;</span>
|
|
4495
|
+
<span class="cstat-no" title="statement not covered" > code += `${property.toEmbeddedTS(shiftState(state, code, { inline: true }))}: `;</span>
|
|
4496
|
+
<span class="cstat-no" title="statement not covered" > code += propertyType</span>
|
|
4497
|
+
? propertyType.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
4498
|
+
: `nasl.core.Incompatible<typeof ${temp}, void>`;
|
|
4499
|
+
<span class="cstat-no" title="statement not covered" > code += ` = ${temp};\n`;</span>
|
|
4653
4500
|
} else <span class="cstat-no" title="statement not covered" >if (propertyType) {</span>
|
|
4654
4501
|
<span class="cstat-no" title="statement not covered" > code += `${indent2}let ${property.name}: `;</span>
|
|
4655
|
-
<span class="cstat-no" title="statement not covered" > code += `${
|
|
4502
|
+
<span class="cstat-no" title="statement not covered" > code += `${propertyType.toEmbeddedTS(shiftState(state, code, { inline: true }))}; `;</span>
|
|
4656
4503
|
<span class="cstat-no" title="statement not covered" > code += `<`;</span>
|
|
4657
|
-
<span class="cstat-no" title="statement not covered" > code += `${
|
|
4504
|
+
<span class="cstat-no" title="statement not covered" > code += `${property.toEmbeddedTS(shiftState(state, code, { inline: true }))}`;</span>
|
|
4658
4505
|
<span class="cstat-no" title="statement not covered" > code += `>${property.name};\n`;</span>
|
|
4659
4506
|
} else {
|
|
4660
4507
|
<span class="cstat-no" title="statement not covered" > code += `${indent2}const `;</span>
|
|
4661
|
-
<span class="cstat-no" title="statement not covered" > code +=
|
|
4508
|
+
<span class="cstat-no" title="statement not covered" > code += property.toEmbeddedTS(shiftState(state, code, { inline: true }));</span>
|
|
4662
4509
|
<span class="cstat-no" title="statement not covered" > code += ';\n';</span>
|
|
4663
4510
|
}
|
|
4664
4511
|
});
|
|
4665
4512
|
<span class="cstat-no" title="statement not covered" > code += `${indent2}return {\n`;</span>
|
|
4666
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4513
|
+
<span class="cstat-no" title="statement not covered" > this.properties.forEach(<span class="fstat-no" title="function not covered" >(p</span>roperty) => {</span>
|
|
4667
4514
|
<span class="cstat-no" title="statement not covered" > code += `${indent3}${property.name},\n`;</span>
|
|
4668
4515
|
});
|
|
4669
4516
|
<span class="cstat-no" title="statement not covered" > code += `${indent3}__name: "AStructure_${genHash(JSON.stringify(this))}" as const,\n`;</span>
|
|
4670
4517
|
<span class="cstat-no" title="statement not covered" > code += `${indent2}}\n`;</span>
|
|
4518
|
+
|
|
4671
4519
|
<span class="cstat-no" title="statement not covered" > code += `${indent1}};\n`;</span>
|
|
4520
|
+
|
|
4672
4521
|
<span class="cstat-no" title="statement not covered" > code += `${indent1}return __newComposite();\n`;</span>
|
|
4673
4522
|
<span class="cstat-no" title="statement not covered" > code += `${indent0}})()`;</span>
|
|
4674
4523
|
}
|
|
@@ -4678,10 +4527,7 @@ export class NewComposite extends LogicItem {
|
|
|
4678
4527
|
@withSourceMap()
|
|
4679
4528
|
<span class="fstat-no" title="function not covered" > toNaturalTS(</span>): string {
|
|
4680
4529
|
let code = <span class="cstat-no" title="statement not covered" >'nasl.util.';</span>
|
|
4681
|
-
<span class="cstat-no" title="statement not covered" > code
|
|
4682
|
-
this?.typeAnnotation?.typeKind === 'anonymousStructure'
|
|
4683
|
-
? 'NewAnonymityStructure'
|
|
4684
|
-
: `NewEntity<${this?.typeAnnotation?.typeName || '__IDENTIFIER__'}>`;
|
|
4530
|
+
<span class="cstat-no" title="statement not covered" > code += this?.typeAnnotation?.typeKind === 'anonymousStructure' ? 'NewAnonymityStructure' : `NewEntity<${this?.typeAnnotation?.typeName || '__IDENTIFIER__'}>`;</span>
|
|
4685
4531
|
let params = <span class="cstat-no" title="statement not covered" >'';</span>
|
|
4686
4532
|
<span class="cstat-no" title="statement not covered" > this?.properties?.forEach(<span class="fstat-no" title="function not covered" >(i</span>tem, index) => {</span>
|
|
4687
4533
|
<span class="cstat-no" title="statement not covered" > if (item) {</span>
|
|
@@ -4695,8 +4541,7 @@ export class NewComposite extends LogicItem {
|
|
|
4695
4541
|
<span class="cstat-no" title="statement not covered" > return code;</span>
|
|
4696
4542
|
}
|
|
4697
4543
|
|
|
4698
|
-
<span class="fstat-no" title="function not covered" >
|
|
4699
|
-
const self = <span class="cstat-no" title="statement not covered" >this;</span>
|
|
4544
|
+
<span class="fstat-no" title="function not covered" > getInitCode(</span>state?: TranslatorState): string {
|
|
4700
4545
|
const indent1 = <span class="cstat-no" title="statement not covered" >indent((state?.tabSize || 0) + 1);</span>
|
|
4701
4546
|
const indent2 = <span class="cstat-no" title="statement not covered" >indent((state?.tabSize || 0) + 2);</span>
|
|
4702
4547
|
const indent3 = <span class="cstat-no" title="statement not covered" >indent((state?.tabSize || 0) + 3);</span>
|
|
@@ -4704,7 +4549,7 @@ export class NewComposite extends LogicItem {
|
|
|
4704
4549
|
let code = <span class="cstat-no" title="statement not covered" >'';</span>
|
|
4705
4550
|
const nameMap = <span class="cstat-no" title="statement not covered" >new Map();</span>
|
|
4706
4551
|
const rightMap = <span class="cstat-no" title="statement not covered" >new Map();</span>
|
|
4707
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4552
|
+
<span class="cstat-no" title="statement not covered" > this.assignmentLines.forEach(<span class="fstat-no" title="function not covered" >({</span> leftIndex, rightIndex }) => {</span>
|
|
4708
4553
|
const leftSecondIndex = <span class="cstat-no" title="statement not covered" >leftIndex[1];</span>
|
|
4709
4554
|
const [rightFirst, rightSecond] = <span class="cstat-no" title="statement not covered" >[rightIndex[0], rightIndex[1]];</span>
|
|
4710
4555
|
const leftItem = <span class="cstat-no" title="statement not covered" >this.properties[leftSecondIndex];</span>
|
|
@@ -4715,26 +4560,24 @@ export class NewComposite extends LogicItem {
|
|
|
4715
4560
|
});
|
|
4716
4561
|
<span class="cstat-no" title="statement not covered" > code += '(() => { ';</span>
|
|
4717
4562
|
// 提供sourcemap,获取类型标注和上下文可选变量
|
|
4718
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4719
|
-
let ts = <span class="cstat-no" title="statement not covered" >
|
|
4563
|
+
<span class="cstat-no" title="statement not covered" > this.rights.forEach(<span class="fstat-no" title="function not covered" >(r</span>ight) => {</span>
|
|
4564
|
+
let ts = <span class="cstat-no" title="statement not covered" >right.expression.toEmbeddedTS(shiftState(state, code, { inline: true }));</span>
|
|
4720
4565
|
<span class="cstat-no" title="statement not covered" > if (rightMap.has(right.expression)) <span class="cstat-no" title="statement not covered" >rightMap.set(right.expression, ts);</span></span>
|
|
4721
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4722
|
-
<span class="cstat-no" title="statement not covered" > ts =
|
|
4723
|
-
<span class="cstat-no" title="statement not covered" > if (rightMap.has(member))
|
|
4724
|
-
|
|
4725
|
-
}
|
|
4726
|
-
}
|
|
4566
|
+
<span class="cstat-no" title="statement not covered" > right.members.forEach(<span class="fstat-no" title="function not covered" >(m</span>ember) => {</span>
|
|
4567
|
+
<span class="cstat-no" title="statement not covered" > ts = member.toEmbeddedTS(shiftState(state, code, { inline: true }));</span>
|
|
4568
|
+
<span class="cstat-no" title="statement not covered" > if (rightMap.has(member)) <span class="cstat-no" title="statement not covered" >rightMap.set(member, ts);</span></span>
|
|
4569
|
+
});
|
|
4727
4570
|
});
|
|
4728
4571
|
// 方便ts报错检查
|
|
4729
4572
|
<span class="cstat-no" title="statement not covered" > code += 'function __newComposite() { ';</span>
|
|
4730
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4573
|
+
<span class="cstat-no" title="statement not covered" > this.properties.forEach(<span class="fstat-no" title="function not covered" >(p</span>roperty, index) => {</span>
|
|
4731
4574
|
const { name } = <span class="cstat-no" title="statement not covered" >property;</span>
|
|
4732
|
-
const propertyType = <span class="cstat-no" title="statement not covered" >
|
|
4575
|
+
const propertyType = <span class="cstat-no" title="statement not covered" >this.typeAnnotation.properties[index]?.typeAnnotation;</span>
|
|
4733
4576
|
const rightItem = <span class="cstat-no" title="statement not covered" >nameMap.get(name);</span>
|
|
4734
4577
|
let ts = <span class="cstat-no" title="statement not covered" >rightMap.get(rightItem);</span>
|
|
4735
|
-
<span class="cstat-no" title="statement not covered" > ts =
|
|
4578
|
+
<span class="cstat-no" title="statement not covered" > ts = this.getForeachCode(ts);</span>
|
|
4736
4579
|
<span class="cstat-no" title="statement not covered" > if (propertyType) {</span>
|
|
4737
|
-
<span class="cstat-no" title="statement not covered" > code += `const ${name}: ${
|
|
4580
|
+
<span class="cstat-no" title="statement not covered" > code += `const ${name}: ${propertyType.toEmbeddedTS(shiftState(state, code, { inline: true }))}; `;</span>
|
|
4738
4581
|
} else <span class="cstat-no" title="statement not covered" >if (ts !== undefined) {</span>
|
|
4739
4582
|
<span class="cstat-no" title="statement not covered" > code += `const ${name} = ${['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts) ? null : ts}; `;</span>
|
|
4740
4583
|
} else {
|
|
@@ -4755,7 +4598,7 @@ export class NewComposite extends LogicItem {
|
|
|
4755
4598
|
<span class="cstat-no" title="statement not covered" > return code;</span>
|
|
4756
4599
|
}
|
|
4757
4600
|
|
|
4758
|
-
<span class="fstat-no" title="function not covered" >
|
|
4601
|
+
<span class="fstat-no" title="function not covered" > getNewCompositeCode(</span>state?: TranslatorState): string {
|
|
4759
4602
|
const indent0 = <span class="cstat-no" title="statement not covered" >indent(state?.tabSize || 0);</span>
|
|
4760
4603
|
const indent1 = <span class="cstat-no" title="statement not covered" >indent((state?.tabSize || 0) + 1);</span>
|
|
4761
4604
|
const indent2 = <span class="cstat-no" title="statement not covered" >indent((state?.tabSize || 0) + 2);</span>
|
|
@@ -4764,38 +4607,42 @@ export class NewComposite extends LogicItem {
|
|
|
4764
4607
|
const rightMap = <span class="cstat-no" title="statement not covered" >new Map();</span>
|
|
4765
4608
|
<span class="cstat-no" title="statement not covered" > code += `${indent0}(() => { \n`;</span>
|
|
4766
4609
|
// 提供sourcemap,获取类型标注和上下文可选变量
|
|
4767
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4610
|
+
<span class="cstat-no" title="statement not covered" > this.rights.forEach(<span class="fstat-no" title="function not covered" >(r</span>ight) => {</span>
|
|
4768
4611
|
<span class="cstat-no" title="statement not covered" > code += indent1;</span>
|
|
4769
|
-
<span class="cstat-no" title="statement not covered" > rightMap.set(right.expression,
|
|
4612
|
+
<span class="cstat-no" title="statement not covered" > rightMap.set(right.expression, right.expression.toEmbeddedTS(shiftState(state, code, { inline: true })));</span>
|
|
4770
4613
|
// code += rightMap.get(right.expression);
|
|
4771
4614
|
// code += ';\n';
|
|
4772
4615
|
<span class="cstat-no" title="statement not covered" > if (right.members?.length) {</span>
|
|
4773
4616
|
<span class="cstat-no" title="statement not covered" > code += indent2;</span>
|
|
4774
4617
|
}
|
|
4775
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4776
|
-
<span class="cstat-no" title="statement not covered" > rightMap.set(member,
|
|
4777
|
-
|
|
4778
|
-
|
|
4618
|
+
<span class="cstat-no" title="statement not covered" > right.members.forEach(<span class="fstat-no" title="function not covered" >(m</span>ember) => {</span>
|
|
4619
|
+
<span class="cstat-no" title="statement not covered" > rightMap.set(member, member.toEmbeddedTS(shiftState(state, code, { inline: true })));</span>
|
|
4620
|
+
// code += rightMap.get(member);
|
|
4621
|
+
// code += '; ';
|
|
4622
|
+
});
|
|
4623
|
+
// code += right.members.length ? '\n' : '';
|
|
4624
|
+
});
|
|
4779
4625
|
// 方便ts报错检查
|
|
4780
4626
|
<span class="cstat-no" title="statement not covered" > code += `${indent1}function __newComposite() {\n`;</span>
|
|
4781
4627
|
const { typeAnnotation } = <span class="cstat-no" title="statement not covered" >this;</span>
|
|
4782
4628
|
<span class="cstat-no" title="statement not covered" > if (['nasl.ui', 'nasl.interface', 'nasl.http'].includes(typeAnnotation.typeNamespace)) {</span>
|
|
4783
4629
|
<span class="cstat-no" title="statement not covered" > code += `${indent2}let __obj = new ${typeAnnotation.typeNamespace}.${typeAnnotation.typeName}`;</span>
|
|
4784
4630
|
<span class="cstat-no" title="statement not covered" > code += '({';</span>
|
|
4785
|
-
<span class="cstat-no" title="statement not covered" >
|
|
4631
|
+
<span class="cstat-no" title="statement not covered" > this.assignmentLines.forEach(<span class="fstat-no" title="function not covered" >({</span> leftIndex, rightIndex }) => {</span>
|
|
4786
4632
|
const leftSecondIndex = <span class="cstat-no" title="statement not covered" >leftIndex[1];</span>
|
|
4787
4633
|
const [rightFirst, rightSecond] = <span class="cstat-no" title="statement not covered" >[rightIndex[0], rightIndex[1]];</span>
|
|
4788
4634
|
const leftItem = <span class="cstat-no" title="statement not covered" >this.properties[leftSecondIndex];</span>
|
|
4789
4635
|
const rightItem =
|
|
4790
4636
|
<span class="cstat-no" title="statement not covered" > rightSecond !== undefined ? this.rights[rightFirst].members[rightSecond] : this.rights[rightFirst].expression;</span>
|
|
4791
4637
|
const rightTs = <span class="cstat-no" title="statement not covered" >rightMap.get(rightItem);</span>
|
|
4792
|
-
<span class="cstat-no" title="statement not covered" > code += `${
|
|
4638
|
+
<span class="cstat-no" title="statement not covered" > code += `${leftItem.toEmbeddedTS(shiftState(state, code, { inline: true }))}:`;</span>
|
|
4793
4639
|
<span class="cstat-no" title="statement not covered" > code += `${['__IDENTIFIER__', '__IDENTIFIER__()'].includes(rightTs) ? 'null' : rightMap.get(rightItem)},\n `;</span>
|
|
4794
|
-
}
|
|
4640
|
+
});
|
|
4795
4641
|
<span class="cstat-no" title="statement not covered" > code += '})\n';</span>
|
|
4796
4642
|
}
|
|
4797
4643
|
<span class="cstat-no" title="statement not covered" > code += `${indent2}return __obj;\n`;</span>
|
|
4798
4644
|
<span class="cstat-no" title="statement not covered" > code += `${indent1}};\n`;</span>
|
|
4645
|
+
|
|
4799
4646
|
<span class="cstat-no" title="statement not covered" > code += `${indent1}return __newComposite();\n`;</span>
|
|
4800
4647
|
<span class="cstat-no" title="statement not covered" > code += `${indent0}})()`;</span>
|
|
4801
4648
|
<span class="cstat-no" title="statement not covered" > return code;</span>
|
|
@@ -4840,12 +4687,12 @@ export class NewComposite extends LogicItem {
|
|
|
4840
4687
|
<span class="cstat-no" title="statement not covered" > this.app.emit('collect:end');</span>
|
|
4841
4688
|
}
|
|
4842
4689
|
|
|
4843
|
-
<span class="fstat-no" title="function not covered" >
|
|
4690
|
+
<span class="fstat-no" title="function not covered" > getForeachCode(</span>code: string): string {
|
|
4844
4691
|
// ForEachStatement 内部变量需要替换处理,如 item、index
|
|
4845
4692
|
const forEachStatement = <span class="cstat-no" title="statement not covered" >this.getAncestor('ForEachStatement') as ForEachStatement;</span>
|
|
4846
4693
|
<span class="cstat-no" title="statement not covered" > if (forEachStatement && code) {</span>
|
|
4847
4694
|
<span class="cstat-no" title="statement not covered" > code = code.replaceAll('\n', ' ');</span>
|
|
4848
|
-
<span class="cstat-no" title="statement not covered" > code =
|
|
4695
|
+
<span class="cstat-no" title="statement not covered" > code = new Logic().handleForEachCode(code, forEachStatement);</span>
|
|
4849
4696
|
}
|
|
4850
4697
|
<span class="cstat-no" title="statement not covered" > return code;</span>
|
|
4851
4698
|
}
|
|
@@ -4867,7 +4714,7 @@ export default NewComposite;
|
|
|
4867
4714
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
4868
4715
|
Code coverage generated by
|
|
4869
4716
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
4870
|
-
at 2023-
|
|
4717
|
+
at 2023-10-18T11:36:07.885Z
|
|
4871
4718
|
</div>
|
|
4872
4719
|
<script src="../../prettify.js"></script>
|
|
4873
4720
|
<script>
|