@abaplint/transpiler-cli 2.2.16 → 2.2.18

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.
Files changed (2) hide show
  1. package/build/bundle.js +3 -3
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -13546,7 +13546,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
13546
13546
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13547
13547
 
13548
13548
  "use strict";
13549
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodSourceTranspiler = void 0;\r\n/* eslint-disable max-len */\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nclass MethodSourceTranspiler {\r\n constructor(prepend) {\r\n this.prepend = (prepend || \"\") + \"await \";\r\n }\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n const children = node.getChildren();\r\n let call = \"\";\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n const nextChild = children[i + 1];\r\n if (child.get() instanceof core_1.Expressions.ClassName) {\r\n call += traversal.lookupClassOrInterface(child.concatTokens(), child.getFirstToken());\r\n }\r\n else if (child.get() instanceof core_1.Expressions.Dynamic && (nextChild === null || nextChild === void 0 ? void 0 : nextChild.concatTokens()) === \"=>\") {\r\n const second = child.getChildren()[1];\r\n const lookupException = traversal.lookupClassOrInterface(\"'CX_SY_DYN_CALL_ILLEGAL_CLASS'\", child.getFirstToken(), true);\r\n if (second.get() instanceof core_1.Expressions.FieldChain && second instanceof core_1.Nodes.ExpressionNode) {\r\n const t = new _1.FieldChainTranspiler(true).transpile(second, traversal).getCode();\r\n call = traversal.lookupClassOrInterface(t, child.getFirstToken(), true);\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_CLASS not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else if (second.get() instanceof core_1.Expressions.Constant) {\r\n call = traversal.lookupClassOrInterface(second.getFirstToken().getStr(), child.getFirstToken(), true);\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_CLASS not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-Unexpected\");\r\n }\r\n }\r\n else if (child.get() instanceof core_1.Expressions.Dynamic) {\r\n const second = child.getChildren()[1];\r\n const lookupException = traversal.lookupClassOrInterface(\"'CX_SY_DYN_CALL_ILLEGAL_METHOD'\", child.getFirstToken(), true);\r\n if (second.get() instanceof core_1.Expressions.FieldChain) {\r\n call += \"[\";\r\n call += traversal.traverse(second).getCode();\r\n call += \".get().toLowerCase()]\";\r\n }\r\n else if (second.get() instanceof core_1.Expressions.Constant) {\r\n if (call === \"\") {\r\n call = \"this.\";\r\n }\r\n else if (call.endsWith(\".\") === false) {\r\n call += \".\";\r\n }\r\n call += second.getFirstToken().getStr().replace(/\\'/g, \"\").toLowerCase().replace(\"~\", \"$\");\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-Unexpected\");\r\n }\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_METHOD not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else if (child.get() instanceof core_1.Expressions.MethodName) {\r\n if (i === 0) {\r\n this.prepend += \"this.\";\r\n }\r\n const methodName = traversal_1.Traversal.escapeClassName(child.concatTokens().toLowerCase().replace(\"~\", \"$\"));\r\n call += methodName;\r\n }\r\n else if (child.concatTokens() === \"=>\") {\r\n call += \".\";\r\n }\r\n else if (child.concatTokens() === \"->\") {\r\n if (ret.getCode() !== \"super\") {\r\n call += \".get()\";\r\n }\r\n if (!(nextChild.get() instanceof core_1.Expressions.Dynamic)) {\r\n call += \".\";\r\n }\r\n }\r\n else if (child.get() instanceof core_1.Expressions.FieldChain) {\r\n call += traversal.traverse(child).getCode();\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-\" + child.get().constructor.name + \"-todo\");\r\n }\r\n }\r\n ret.appendString(this.prepend);\r\n ret.appendString(call);\r\n return ret;\r\n }\r\n}\r\nexports.MethodSourceTranspiler = MethodSourceTranspiler;\r\n//# sourceMappingURL=method_source.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/method_source.js?");
13549
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodSourceTranspiler = void 0;\r\n/* eslint-disable max-len */\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nclass MethodSourceTranspiler {\r\n constructor(prepend) {\r\n this.prepend = (prepend || \"\") + \"await \";\r\n }\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk();\r\n const children = node.getChildren();\r\n let call = \"\";\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n const nextChild = children[i + 1];\r\n if (child.get() instanceof core_1.Expressions.ClassName) {\r\n call += traversal.lookupClassOrInterface(child.concatTokens(), child.getFirstToken());\r\n }\r\n else if (child.get() instanceof core_1.Expressions.Dynamic && (nextChild === null || nextChild === void 0 ? void 0 : nextChild.concatTokens()) === \"=>\") {\r\n const second = child.getChildren()[1];\r\n const lookupException = traversal.lookupClassOrInterface(\"'CX_SY_DYN_CALL_ILLEGAL_CLASS'\", child.getFirstToken(), true);\r\n if (second.get() instanceof core_1.Expressions.FieldChain && second instanceof core_1.Nodes.ExpressionNode) {\r\n const t = new _1.FieldChainTranspiler(true).transpile(second, traversal).getCode();\r\n call = traversal.lookupClassOrInterface(t, child.getFirstToken(), true);\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_CLASS not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else if (second.get() instanceof core_1.Expressions.Constant) {\r\n call = traversal.lookupClassOrInterface(second.getFirstToken().getStr(), child.getFirstToken(), true);\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_CLASS not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-Unexpected\");\r\n }\r\n }\r\n else if (child.get() instanceof core_1.Expressions.Dynamic) {\r\n const second = child.getChildren()[1];\r\n const lookupException = traversal.lookupClassOrInterface(\"'CX_SY_DYN_CALL_ILLEGAL_METHOD'\", child.getFirstToken(), true);\r\n if (second.get() instanceof core_1.Expressions.FieldChain) {\r\n if (call.endsWith(\".\")) {\r\n call = call.substring(0, call.length - 1);\r\n }\r\n call += \"[\";\r\n call += traversal.traverse(second).getCode();\r\n call += \".get().toLowerCase()]\";\r\n }\r\n else if (second.get() instanceof core_1.Expressions.Constant) {\r\n if (call === \"\") {\r\n call = \"this.\";\r\n }\r\n else if (call.endsWith(\".\") === false) {\r\n call += \".\";\r\n }\r\n call += second.getFirstToken().getStr().replace(/\\'/g, \"\").toLowerCase().replace(\"~\", \"$\");\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-Unexpected\");\r\n }\r\n ret.appendString(`if (${call} === undefined && ${lookupException} === undefined) { throw \"CX_SY_DYN_CALL_ILLEGAL_METHOD not found\"; }\\n`);\r\n ret.appendString(`if (${call} === undefined) { throw new ${lookupException}(); }\\n`);\r\n }\r\n else if (child.get() instanceof core_1.Expressions.MethodName) {\r\n if (i === 0) {\r\n this.prepend += \"this.\";\r\n }\r\n const methodName = traversal_1.Traversal.escapeClassName(child.concatTokens().toLowerCase().replace(\"~\", \"$\"));\r\n call += methodName;\r\n }\r\n else if (child.concatTokens() === \"=>\") {\r\n call += \".\";\r\n }\r\n else if (child.concatTokens() === \"->\") {\r\n if (ret.getCode() !== \"super\") {\r\n call += \".get()\";\r\n }\r\n if (!(nextChild.get() instanceof core_1.Expressions.Dynamic)) {\r\n call += \".\";\r\n }\r\n }\r\n else if (child.get() instanceof core_1.Expressions.FieldChain) {\r\n call += traversal.traverse(child).getCode();\r\n }\r\n else {\r\n ret.appendString(\"MethodSourceTranspiler-\" + child.get().constructor.name + \"-todo\");\r\n }\r\n }\r\n ret.appendString(this.prepend);\r\n ret.appendString(call);\r\n return ret;\r\n }\r\n}\r\nexports.MethodSourceTranspiler = MethodSourceTranspiler;\r\n//# sourceMappingURL=method_source.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/method_source.js?");
13550
13550
 
13551
13551
  /***/ }),
13552
13552
 
@@ -14668,7 +14668,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14668
14668
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14669
14669
 
14670
14670
  "use strict";
14671
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass MethodImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const token = node.findFirstExpression(abaplint.Expressions.MethodName).getFirstToken();\r\n let methodName = token.getStr();\r\n const scope = traversal.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"MethodTranspiler, scope not found, \" + methodName);\r\n }\r\n else if (scope.getIdentifier().sname !== methodName) {\r\n throw new Error(\"MethodTranspiler, wrong scope found, \" + scope.getIdentifier().sname);\r\n }\r\n let after = \"\";\r\n const classDef = traversal.getClassDefinition(token);\r\n let unique = \"\";\r\n if (methodName.toUpperCase() === \"CONSTRUCTOR\" && classDef) {\r\n // note that all ABAP identifiers are lower cased, sometimes the kernel does magic, so it needs to know the method input name\r\n unique = \"INPUT\";\r\n after = traversal.buildConstructorContents(scope.getParent(), classDef);\r\n methodName = \"constructor_\";\r\n }\r\n const methodDef = this.findMethodParameters(scope);\r\n const vars = scope.getData().vars;\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n const varName = n.toLowerCase();\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n || identifier.getMeta().includes(\"changing\" /* abaplint.IdentifierMeta.MethodChanging */)\r\n || identifier.getMeta().includes(\"exporting\" /* abaplint.IdentifierMeta.MethodExporting */)) {\r\n if (unique === \"\") {\r\n unique = \"INPUT\";\r\n }\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n const type = identifier.getType();\r\n const charOne = type instanceof abaplint.BasicTypes.CharacterType && type.getLength() === 1;\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n && type.isGeneric() === false\r\n && charOne === false) {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \".set(\" + unique + \".\" + varName + \");}\\n\";\r\n }\r\n else {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \" = \" + unique + \".\" + varName + \";}\\n\";\r\n }\r\n const parameterDefault = methodDef === null || methodDef === void 0 ? void 0 : methodDef.getParameterDefault(varName);\r\n if (parameterDefault) {\r\n let val = \"\";\r\n if (parameterDefault.get() instanceof abaplint.Expressions.Constant) {\r\n val = new expressions_1.ConstantTranspiler().transpile(parameterDefault, traversal).getCode();\r\n }\r\n else if (parameterDefault.get() instanceof abaplint.Expressions.FieldChain) {\r\n if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_true\") {\r\n val = \"abap.builtin.abap_true\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_false\") {\r\n val = \"abap.builtin.abap_false\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"space\") {\r\n val = \"abap.builtin.space\";\r\n }\r\n else {\r\n // note: this can be difficult, the \"def\" might be from an interface, ie. a different scope than the method\r\n val = new expressions_1.FieldChainTranspiler().transpile(parameterDefault, traversal, true, methodDef === null || methodDef === void 0 ? void 0 : methodDef.getFilename()).getCode();\r\n if (val.startsWith(parameterDefault.getFirstToken().getStr().toLowerCase()) === true) {\r\n val = \"this.\" + val;\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"MethodImplementationTranspiler, unknown default param type\");\r\n }\r\n after += \"if (\" + unique + \" === undefined || \" + unique + \".\" + varName + \" === undefined) {\" + varName + \" = \" + val + \";}\\n\";\r\n }\r\n }\r\n else if (identifier.getMeta().includes(\"returning\" /* abaplint.IdentifierMeta.MethodReturning */)) {\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n }\r\n }\r\n if (after.length > 0) { // argh\r\n after = \"\\n\" + after;\r\n after = after.substring(0, after.length - 1);\r\n }\r\n const method = this.findMethod(methodName, classDef, traversal);\r\n let staticMethod = \"\";\r\n methodName = methodName.replace(\"~\", \"$\").toLowerCase();\r\n if (method && method.isStatic()) {\r\n // in ABAP static methods can be called with instance arrows, \"->\"\r\n const className = (_b = (_a = scope.getParent()) === null || _a === void 0 ? void 0 : _a.getIdentifier().sname) === null || _b === void 0 ? void 0 : _b.toLowerCase();\r\n staticMethod = \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\\n\" +\r\n \"return \" + traversal_1.Traversal.escapeClassName(className) + \".\" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \");\\n\" +\r\n \"}\\n\" + \"static \";\r\n }\r\n const str = staticMethod + \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\" + after;\r\n return new chunk_1.Chunk().append(str, node, traversal);\r\n }\r\n findMethod(name, cdef, traversal) {\r\n var _a, _b;\r\n if (cdef === undefined) {\r\n return undefined;\r\n }\r\n if (name.includes(\"~\")) {\r\n const split = name.split(\"~\");\r\n const intfName = split[0];\r\n name = split[1];\r\n const scope = traversal.findCurrentScopeByToken(cdef.getToken());\r\n const intf = traversal.findInterfaceDefinition(intfName, scope);\r\n return (_a = intf === null || intf === void 0 ? void 0 : intf.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getByName(name);\r\n }\r\n else {\r\n return (_b = cdef.getMethodDefinitions()) === null || _b === void 0 ? void 0 : _b.getByName(name);\r\n }\r\n }\r\n findMethodParameters(scope) {\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodImplementationReference\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n return r.resolved.getParameters();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.MethodImplementationTranspiler = MethodImplementationTranspiler;\r\n//# sourceMappingURL=method_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/method_implementation.js?");
14671
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodImplementationTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst transpile_types_1 = __webpack_require__(/*! ../transpile_types */ \"./node_modules/@abaplint/transpiler/build/src/transpile_types.js\");\r\nconst traversal_1 = __webpack_require__(/*! ../traversal */ \"./node_modules/@abaplint/transpiler/build/src/traversal.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass MethodImplementationTranspiler {\r\n transpile(node, traversal) {\r\n var _a, _b;\r\n const token = node.findFirstExpression(abaplint.Expressions.MethodName).getFirstToken();\r\n let methodName = token.getStr();\r\n const scope = traversal.findCurrentScopeByToken(token);\r\n if (scope === undefined) {\r\n throw new Error(\"MethodTranspiler, scope not found, \" + methodName);\r\n }\r\n else if (scope.getIdentifier().sname !== methodName) {\r\n throw new Error(\"MethodTranspiler, wrong scope found, \" + scope.getIdentifier().sname);\r\n }\r\n let after = \"\";\r\n const classDef = traversal.getClassDefinition(token);\r\n let unique = \"\";\r\n if (methodName.toUpperCase() === \"CONSTRUCTOR\" && classDef) {\r\n // note that all ABAP identifiers are lower cased, sometimes the kernel does magic, so it needs to know the method input name\r\n unique = \"INPUT\";\r\n after = traversal.buildConstructorContents(scope.getParent(), classDef);\r\n methodName = \"constructor_\";\r\n }\r\n const methodDef = this.findMethodParameters(scope);\r\n const vars = scope.getData().vars;\r\n for (const n in vars) {\r\n const identifier = vars[n];\r\n const varName = n.toLowerCase();\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n || identifier.getMeta().includes(\"changing\" /* abaplint.IdentifierMeta.MethodChanging */)\r\n || identifier.getMeta().includes(\"exporting\" /* abaplint.IdentifierMeta.MethodExporting */)) {\r\n if (unique === \"\") {\r\n unique = \"INPUT\";\r\n }\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n const type = identifier.getType();\r\n const charOne = type instanceof abaplint.BasicTypes.CharacterType && type.getLength() === 1;\r\n if (identifier.getMeta().includes(\"importing\" /* abaplint.IdentifierMeta.MethodImporting */)\r\n && type.isGeneric() === false\r\n && charOne === false) {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \".set(\" + unique + \".\" + varName + \");}\\n\";\r\n }\r\n else {\r\n after += \"if (\" + unique + \" && \" + unique + \".\" + varName + \") {\" + varName + \" = \" + unique + \".\" + varName + \";}\\n\";\r\n }\r\n const parameterDefault = methodDef === null || methodDef === void 0 ? void 0 : methodDef.getParameterDefault(varName);\r\n if (parameterDefault) {\r\n let val = \"\";\r\n if (parameterDefault.get() instanceof abaplint.Expressions.Constant) {\r\n val = new expressions_1.ConstantTranspiler().transpile(parameterDefault, traversal).getCode();\r\n }\r\n else if (parameterDefault.get() instanceof abaplint.Expressions.FieldChain) {\r\n if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_true\") {\r\n val = \"abap.builtin.abap_true\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"abap_false\") {\r\n val = \"abap.builtin.abap_false\";\r\n }\r\n else if (parameterDefault.getFirstToken().getStr().toLowerCase() === \"space\") {\r\n val = \"abap.builtin.space\";\r\n }\r\n else if (parameterDefault.concatTokens().toLowerCase() === \"sy-uname\") {\r\n val = \"abap.builtin.sy.get().uname\";\r\n }\r\n else {\r\n // note: this can be difficult, the \"def\" might be from an interface, ie. a different scope than the method\r\n val = new expressions_1.FieldChainTranspiler().transpile(parameterDefault, traversal, true, methodDef === null || methodDef === void 0 ? void 0 : methodDef.getFilename()).getCode();\r\n if (val.startsWith(parameterDefault.getFirstToken().getStr().toLowerCase()) === true) {\r\n val = \"this.\" + val;\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"MethodImplementationTranspiler, unknown default param type\");\r\n }\r\n after += \"if (\" + unique + \" === undefined || \" + unique + \".\" + varName + \" === undefined) {\" + varName + \" = \" + val + \";}\\n\";\r\n }\r\n }\r\n else if (identifier.getMeta().includes(\"returning\" /* abaplint.IdentifierMeta.MethodReturning */)) {\r\n after = after + new transpile_types_1.TranspileTypes().declare(identifier) + \"\\n\";\r\n }\r\n }\r\n if (after.length > 0) { // argh\r\n after = \"\\n\" + after;\r\n after = after.substring(0, after.length - 1);\r\n }\r\n const method = this.findMethod(methodName, classDef, traversal);\r\n let staticMethod = \"\";\r\n methodName = methodName.replace(\"~\", \"$\").toLowerCase();\r\n if (method && method.isStatic()) {\r\n // in ABAP static methods can be called with instance arrows, \"->\"\r\n const className = (_b = (_a = scope.getParent()) === null || _a === void 0 ? void 0 : _a.getIdentifier().sname) === null || _b === void 0 ? void 0 : _b.toLowerCase();\r\n staticMethod = \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\\n\" +\r\n \"return \" + traversal_1.Traversal.escapeClassName(className) + \".\" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \");\\n\" +\r\n \"}\\n\" + \"static \";\r\n }\r\n const str = staticMethod + \"async \" + traversal_1.Traversal.escapeClassName(methodName) + \"(\" + unique + \") {\" + after;\r\n return new chunk_1.Chunk().append(str, node, traversal);\r\n }\r\n findMethod(name, cdef, traversal) {\r\n var _a, _b;\r\n if (cdef === undefined) {\r\n return undefined;\r\n }\r\n if (name.includes(\"~\")) {\r\n const split = name.split(\"~\");\r\n const intfName = split[0];\r\n name = split[1];\r\n const scope = traversal.findCurrentScopeByToken(cdef.getToken());\r\n const intf = traversal.findInterfaceDefinition(intfName, scope);\r\n return (_a = intf === null || intf === void 0 ? void 0 : intf.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getByName(name);\r\n }\r\n else {\r\n return (_b = cdef.getMethodDefinitions()) === null || _b === void 0 ? void 0 : _b.getByName(name);\r\n }\r\n }\r\n findMethodParameters(scope) {\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType === abaplint.ReferenceType.MethodImplementationReference\r\n && r.resolved instanceof abaplint.Types.MethodDefinition) {\r\n return r.resolved.getParameters();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.MethodImplementationTranspiler = MethodImplementationTranspiler;\r\n//# sourceMappingURL=method_implementation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/method_implementation.js?");
14672
14672
 
14673
14673
  /***/ }),
14674
14674
 
@@ -14734,7 +14734,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14734
14734
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14735
14735
 
14736
14736
  "use strict";
14737
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OverlayTranspiler = void 0;\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass OverlayTranspiler {\r\n transpile(_node, _traversal) {\r\n return new chunk_1.Chunk(`throw new Error(\"Overlay, transpiler todo\");`);\r\n }\r\n}\r\nexports.OverlayTranspiler = OverlayTranspiler;\r\n//# sourceMappingURL=overlay.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/overlay.js?");
14737
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OverlayTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass OverlayTranspiler {\r\n transpile(node, traversal) {\r\n const ret = new chunk_1.Chunk().append(\"abap.statements.overlay(\", node, traversal);\r\n ret.appendChunk(traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target)));\r\n for (const s of node.findDirectExpressions(abaplint.Expressions.Source)) {\r\n ret.appendString(\",\");\r\n ret.appendChunk(traversal.traverse(s));\r\n }\r\n ret.append(\");\", node.getLastToken(), traversal);\r\n return ret;\r\n }\r\n}\r\nexports.OverlayTranspiler = OverlayTranspiler;\r\n//# sourceMappingURL=overlay.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/overlay.js?");
14738
14738
 
14739
14739
  /***/ }),
14740
14740
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.2.16",
3
+ "version": "2.2.18",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,7 +25,7 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.2.16",
28
+ "@abaplint/transpiler": "^2.2.18",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",