@abaplint/transpiler-cli 2.13.56 → 2.13.57
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/build/bundle.js +162 -21
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -17217,11 +17217,12 @@ class ModifyEntities {
|
|
|
17217
17217
|
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
17218
17218
|
const end = (0, combi_1.optPrio)((0, combi_1.per)(failed, result, mapped, reported));
|
|
17219
17219
|
const entities = (0, combi_1.seq)((0, combi_1.optPrio)("AUGMENTING"), "ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plusPrio)((0, combi_1.seq)("ENTITY", expressions_1.NamespaceSimpleName, (0, combi_1.plus)(operation))));
|
|
17220
|
+
const dynamic = (0, combi_1.seq)("ENTITIES", (0, combi_1.optPrio)((0, combi_1.altPrio)("IN LOCAL MODE", (0, combi_1.seq)((0, combi_1.opt)("FORWARDING"), "PRIVILEGED"))), "OPERATIONS", expressions_1.Source);
|
|
17220
17221
|
const create2 = (0, combi_1.seq)("CREATE", fieldsWith, (0, combi_1.opt)((0, combi_1.seq)("CREATE BY", expressions_1.EMLEntityPath, fieldsWith)));
|
|
17221
17222
|
const create3 = (0, combi_1.seq)("CREATE BY", expressions_1.EMLEntityPath, fieldsWith);
|
|
17222
17223
|
const create4 = (0, combi_1.seq)("CREATE FROM", expressions_1.Source, (0, combi_1.plus)((0, combi_1.seq)("CREATE BY", expressions_1.EMLEntityPath, "FROM", expressions_1.Source)));
|
|
17223
17224
|
const entity = (0, combi_1.seq)("ENTITY", (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.alt)(expressions_1.NamespaceSimpleName, expressions_1.EntityAssociation), (0, combi_1.alt)(execute, create, updateFields, deleteFrom, updateSetFields, updateFrom, create2, create3, create4));
|
|
17224
|
-
return (0, combi_1.ver)(version_1.Release.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, entity), end), { also: combi_1.AlsoIn.OpenABAP });
|
|
17225
|
+
return (0, combi_1.ver)(version_1.Release.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, dynamic, entity), end), { also: combi_1.AlsoIn.OpenABAP });
|
|
17225
17226
|
}
|
|
17226
17227
|
}
|
|
17227
17228
|
exports.ModifyEntities = ModifyEntities;
|
|
@@ -39500,7 +39501,7 @@ class CreateObject {
|
|
|
39500
39501
|
this.validateParameters(cdef, node, input);
|
|
39501
39502
|
}
|
|
39502
39503
|
static checkInstantiationAllowed(cdef, input) {
|
|
39503
|
-
var _a, _b, _c
|
|
39504
|
+
var _a, _b, _c;
|
|
39504
39505
|
const createVis = cdef.getCreateVisibility();
|
|
39505
39506
|
if (createVis === visibility_1.Visibility.Public) {
|
|
39506
39507
|
return undefined;
|
|
@@ -39517,23 +39518,30 @@ class CreateObject {
|
|
|
39517
39518
|
input.scope.isLocalFriend(cdef.getName(), enclosingClass)) {
|
|
39518
39519
|
return undefined;
|
|
39519
39520
|
}
|
|
39521
|
+
const enclosingDefinition = input.scope.findClassDefinition(enclosingClass);
|
|
39522
|
+
if (enclosingDefinition !== undefined) {
|
|
39523
|
+
const implementedInterfaces = new _object_oriented_1.ObjectOriented(input.scope).findInterfaces(enclosingDefinition);
|
|
39524
|
+
if (cdef.getFriends().some(friend => implementedInterfaces.some(implemented => implemented.name.toUpperCase() === friend.toUpperCase()))) {
|
|
39525
|
+
return undefined;
|
|
39526
|
+
}
|
|
39527
|
+
}
|
|
39520
39528
|
// subclasses of friends also have friendship
|
|
39521
|
-
let enclosingSup =
|
|
39529
|
+
let enclosingSup = enclosingDefinition === null || enclosingDefinition === void 0 ? void 0 : enclosingDefinition.getSuperClass();
|
|
39522
39530
|
while (enclosingSup !== undefined) {
|
|
39523
39531
|
if (cdef.getFriends().some(f => f.toUpperCase() === enclosingSup.toUpperCase()) ||
|
|
39524
39532
|
input.scope.isLocalFriend(cdef.getName(), enclosingSup)) {
|
|
39525
39533
|
return undefined;
|
|
39526
39534
|
}
|
|
39527
|
-
enclosingSup = (
|
|
39535
|
+
enclosingSup = (_a = input.scope.findClassDefinition(enclosingSup)) === null || _a === void 0 ? void 0 : _a.getSuperClass();
|
|
39528
39536
|
}
|
|
39529
39537
|
if (createVis === visibility_1.Visibility.Protected) {
|
|
39530
39538
|
// subclasses are also allowed
|
|
39531
|
-
let sup = (
|
|
39539
|
+
let sup = (_b = input.scope.findClassDefinition(enclosingClass)) === null || _b === void 0 ? void 0 : _b.getSuperClass();
|
|
39532
39540
|
while (sup !== undefined) {
|
|
39533
39541
|
if (sup.toUpperCase() === cdef.getName().toUpperCase()) {
|
|
39534
39542
|
return undefined;
|
|
39535
39543
|
}
|
|
39536
|
-
sup = (
|
|
39544
|
+
sup = (_c = input.scope.findClassDefinition(sup)) === null || _c === void 0 ? void 0 : _c.getSuperClass();
|
|
39537
39545
|
}
|
|
39538
39546
|
}
|
|
39539
39547
|
return cdef.getName() + " cannot be instantiated, class is defined as " +
|
|
@@ -52159,6 +52167,7 @@ class ClassDefinition extends _identifier_1.Identifier {
|
|
|
52159
52167
|
this.checkInterfaceVisibility(input, node);
|
|
52160
52168
|
this.checkMethodsFromSuperClasses(input);
|
|
52161
52169
|
this.checkMethodNameConflicts(input);
|
|
52170
|
+
this.checkEventNameConflicts(input);
|
|
52162
52171
|
this.checkClassNameLength(input);
|
|
52163
52172
|
this.checkMethodNameLength(input);
|
|
52164
52173
|
this.checkClassConstructorStatic(input);
|
|
@@ -52298,6 +52307,15 @@ class ClassDefinition extends _identifier_1.Identifier {
|
|
|
52298
52307
|
}
|
|
52299
52308
|
}
|
|
52300
52309
|
}
|
|
52310
|
+
checkEventNameConflicts(input) {
|
|
52311
|
+
for (const e of this.events) {
|
|
52312
|
+
if (this.attributes.findByName(e.getName()) !== undefined
|
|
52313
|
+
|| this.types.getByName(e.getName()) !== undefined
|
|
52314
|
+
|| this.methodDefs.getByName(e.getName()) !== undefined) {
|
|
52315
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, e.getToken(), `"${e.getName()}" already defined`));
|
|
52316
|
+
}
|
|
52317
|
+
}
|
|
52318
|
+
}
|
|
52301
52319
|
findFriends(def, input) {
|
|
52302
52320
|
var _a;
|
|
52303
52321
|
const result = [];
|
|
@@ -70098,7 +70116,7 @@ class Registry {
|
|
|
70098
70116
|
}
|
|
70099
70117
|
static abaplintVersion() {
|
|
70100
70118
|
// magic, see build script "version.js"
|
|
70101
|
-
return "2.120.
|
|
70119
|
+
return "2.120.22";
|
|
70102
70120
|
}
|
|
70103
70121
|
getDDICReferences() {
|
|
70104
70122
|
return this.ddicReferences;
|
|
@@ -104041,6 +104059,14 @@ const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@aba
|
|
|
104041
104059
|
const method_call_param_1 = __webpack_require__(/*! ./method_call_param */ "./node_modules/@abaplint/transpiler/build/src/expressions/method_call_param.js");
|
|
104042
104060
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
104043
104061
|
class MethodCallTranspiler {
|
|
104062
|
+
postName;
|
|
104063
|
+
method;
|
|
104064
|
+
/** @param postName inserted between the method name and the parameters, eg. ".bind(this)"
|
|
104065
|
+
* @param method the already resolved method reference, saves looking it up again */
|
|
104066
|
+
constructor(postName = "", method) {
|
|
104067
|
+
this.postName = postName;
|
|
104068
|
+
this.method = method;
|
|
104069
|
+
}
|
|
104044
104070
|
transpile(node, traversal) {
|
|
104045
104071
|
let post = "";
|
|
104046
104072
|
const nameToken = node.findDirectExpression(core_1.Expressions.MethodName)?.getFirstToken();
|
|
@@ -104048,7 +104074,7 @@ class MethodCallTranspiler {
|
|
|
104048
104074
|
throw new Error("MethodCallTranspiler, name not found");
|
|
104049
104075
|
}
|
|
104050
104076
|
const scope = traversal.findCurrentScopeByToken(nameToken);
|
|
104051
|
-
const m = traversal.findMethodReference(nameToken, scope);
|
|
104077
|
+
const m = this.method ?? traversal.findMethodReference(nameToken, scope);
|
|
104052
104078
|
let name = nameToken.getStr().toLowerCase();
|
|
104053
104079
|
if (traversal.isBuiltinMethod(nameToken)) {
|
|
104054
104080
|
// todo: this is not correct, the method name might be shadowed
|
|
@@ -104073,12 +104099,12 @@ class MethodCallTranspiler {
|
|
|
104073
104099
|
name = `FRIENDS_ACCESS_INSTANCE["${name}"]`;
|
|
104074
104100
|
}
|
|
104075
104101
|
}
|
|
104076
|
-
name = name + "(";
|
|
104102
|
+
name = name + this.postName + "(";
|
|
104077
104103
|
}
|
|
104078
104104
|
else {
|
|
104079
104105
|
// todo: this should never happen?
|
|
104080
104106
|
name = traversal_1.Traversal.escapeNamespace(name.replace("~", "$"));
|
|
104081
|
-
name = name + "(";
|
|
104107
|
+
name = name + this.postName + "(";
|
|
104082
104108
|
}
|
|
104083
104109
|
const step = node.findDirectExpression(core_1.Expressions.MethodCallParam);
|
|
104084
104110
|
if (step === undefined) {
|
|
@@ -104197,22 +104223,46 @@ exports.MethodCallChainTranspiler = void 0;
|
|
|
104197
104223
|
const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
104198
104224
|
const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
|
|
104199
104225
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
104226
|
+
const method_call_1 = __webpack_require__(/*! ./method_call */ "./node_modules/@abaplint/transpiler/build/src/expressions/method_call.js");
|
|
104200
104227
|
class MethodCallChainTranspiler {
|
|
104201
104228
|
transpile(node, traversal) {
|
|
104202
104229
|
let ret = new chunk_1.Chunk();
|
|
104203
|
-
|
|
104230
|
+
const children = node.getChildren();
|
|
104231
|
+
for (const c of children) {
|
|
104204
104232
|
if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.MethodCall) {
|
|
104205
|
-
const
|
|
104233
|
+
const isFirst = c === node.getFirstChild();
|
|
104234
|
+
// "me->name( )" has the same semantics as the unqualified "name( )",
|
|
104235
|
+
// only the first call in the chain is on "me", the rest is dispatched dynamically
|
|
104236
|
+
const viaMe = c === children[2] && traversal_1.Traversal.isMe(children[0]);
|
|
104237
|
+
let prefix = undefined;
|
|
104238
|
+
let method = undefined;
|
|
104239
|
+
const nameToken = isFirst || viaMe
|
|
104240
|
+
? c.findDirectExpression(core_1.Expressions.MethodName)?.getFirstToken()
|
|
104241
|
+
: undefined;
|
|
104242
|
+
// resolving the method reference is a linear scan of the scope, only do it when it can matter
|
|
104243
|
+
const enclosingClass = nameToken ? traversal.enclosingConstructorClass(nameToken) : undefined;
|
|
104244
|
+
if (nameToken && enclosingClass !== undefined) {
|
|
104245
|
+
method = traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken));
|
|
104246
|
+
prefix = traversal.constructorPrototypePrefix(nameToken, method?.def, enclosingClass);
|
|
104247
|
+
}
|
|
104248
|
+
const sub = prefix === undefined
|
|
104249
|
+
? traversal.traverse(c)
|
|
104250
|
+
: new method_call_1.MethodCallTranspiler(".bind(this)", method).transpile(c, traversal);
|
|
104206
104251
|
if (sub.getCode().startsWith("abap.builtin.")
|
|
104207
104252
|
|| sub.getCode().startsWith("await abap.builtin.")) {
|
|
104208
104253
|
ret.appendChunk(sub);
|
|
104209
104254
|
}
|
|
104210
104255
|
else {
|
|
104211
|
-
|
|
104256
|
+
let receiver = ret;
|
|
104257
|
+
let t = isFirst ? "this." : "";
|
|
104258
|
+
if (prefix !== undefined) {
|
|
104259
|
+
t = prefix;
|
|
104260
|
+
receiver = new chunk_1.Chunk(); // discard the "this.me.get()." built for the viaMe case
|
|
104261
|
+
}
|
|
104212
104262
|
ret = new chunk_1.Chunk()
|
|
104213
104263
|
.appendString("(await ")
|
|
104214
104264
|
.append(t, node, traversal)
|
|
104215
|
-
.appendChunk(
|
|
104265
|
+
.appendChunk(receiver)
|
|
104216
104266
|
.appendChunk(sub)
|
|
104217
104267
|
.appendString(")");
|
|
104218
104268
|
}
|
|
@@ -104391,14 +104441,19 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/bui
|
|
|
104391
104441
|
class MethodSourceTranspiler {
|
|
104392
104442
|
prepend;
|
|
104393
104443
|
privatePrefix;
|
|
104394
|
-
|
|
104444
|
+
staticConstructorCall;
|
|
104445
|
+
/** @param staticConstructorCall set to false when building a reference to the method instead of calling it,
|
|
104446
|
+
* eg. SET HANDLER, where the dynamic method is the one to be registered */
|
|
104447
|
+
constructor(prepend, privatePrefix = false, staticConstructorCall = true) {
|
|
104395
104448
|
this.prepend = (prepend || "") + "await ";
|
|
104396
104449
|
this.privatePrefix = privatePrefix;
|
|
104450
|
+
this.staticConstructorCall = staticConstructorCall;
|
|
104397
104451
|
}
|
|
104398
104452
|
transpile(node, traversal) {
|
|
104399
104453
|
const ret = new chunk_1.Chunk();
|
|
104400
104454
|
const children = node.getChildren();
|
|
104401
104455
|
let call = "";
|
|
104456
|
+
let bindConstructorCall = false;
|
|
104402
104457
|
for (let i = 0; i < children.length; i++) {
|
|
104403
104458
|
const child = children[i];
|
|
104404
104459
|
const nextChild = children[i + 1];
|
|
@@ -104460,11 +104515,25 @@ class MethodSourceTranspiler {
|
|
|
104460
104515
|
}
|
|
104461
104516
|
else if (child.get() instanceof core_1.Expressions.MethodName
|
|
104462
104517
|
|| child.get() instanceof core_1.Expressions.AttributeName) {
|
|
104463
|
-
|
|
104518
|
+
const nameToken = child.getFirstToken();
|
|
104519
|
+
const scope = traversal.findCurrentScopeByToken(nameToken);
|
|
104520
|
+
const m = traversal.findMethodReference(nameToken, scope);
|
|
104521
|
+
// "me->name( )" has the same semantics as the unqualified "name( )"
|
|
104522
|
+
const viaMe = i === 2 && children.length === 3 && traversal_1.Traversal.isMe(children[0]);
|
|
104523
|
+
if (this.staticConstructorCall && (i === 0 || viaMe)) {
|
|
104524
|
+
const prefix = traversal.constructorPrototypePrefix(nameToken, m?.def);
|
|
104525
|
+
if (prefix !== undefined) {
|
|
104526
|
+
this.prepend += prefix;
|
|
104527
|
+
call = ""; // discard the "this.me.get()." built for the viaMe case
|
|
104528
|
+
bindConstructorCall = true;
|
|
104529
|
+
}
|
|
104530
|
+
else if (i === 0) {
|
|
104531
|
+
this.prepend += "this.";
|
|
104532
|
+
}
|
|
104533
|
+
}
|
|
104534
|
+
else if (i === 0) {
|
|
104464
104535
|
this.prepend += "this.";
|
|
104465
104536
|
}
|
|
104466
|
-
const nameToken = child.getFirstToken();
|
|
104467
|
-
const m = traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken));
|
|
104468
104537
|
if (m) {
|
|
104469
104538
|
call += traversal_1.Traversal.escapeNamespace(m.name.toLowerCase().replace("~", "$"));
|
|
104470
104539
|
}
|
|
@@ -104487,9 +104556,19 @@ class MethodSourceTranspiler {
|
|
|
104487
104556
|
else if (child.get() instanceof core_1.Expressions.FieldChain
|
|
104488
104557
|
|| child.get() instanceof core_1.Expressions.SourceField) {
|
|
104489
104558
|
const nameToken = child.getFirstToken();
|
|
104490
|
-
const
|
|
104559
|
+
const scope = traversal.findCurrentScopeByToken(nameToken);
|
|
104560
|
+
const m = traversal.findMethodReference(nameToken, scope);
|
|
104491
104561
|
if (i === 0 && m) {
|
|
104492
|
-
|
|
104562
|
+
const prefix = this.staticConstructorCall
|
|
104563
|
+
? traversal.constructorPrototypePrefix(nameToken, m.def)
|
|
104564
|
+
: undefined;
|
|
104565
|
+
if (prefix !== undefined) {
|
|
104566
|
+
this.prepend += prefix;
|
|
104567
|
+
bindConstructorCall = true;
|
|
104568
|
+
}
|
|
104569
|
+
else {
|
|
104570
|
+
this.prepend += "this.";
|
|
104571
|
+
}
|
|
104493
104572
|
if (this.privatePrefix && m.def.getVisibility() === core_1.Visibility.Private
|
|
104494
104573
|
&& m.def.isStatic() === false) { // todo: this is probably wrong?
|
|
104495
104574
|
this.prepend += "#";
|
|
@@ -104510,6 +104589,9 @@ class MethodSourceTranspiler {
|
|
|
104510
104589
|
ret.appendString("MethodSourceTranspiler-" + child.get().constructor.name + "-todo");
|
|
104511
104590
|
}
|
|
104512
104591
|
}
|
|
104592
|
+
if (bindConstructorCall) {
|
|
104593
|
+
call += ".bind(this)";
|
|
104594
|
+
}
|
|
104513
104595
|
ret.appendString(this.prepend);
|
|
104514
104596
|
ret.appendString(call);
|
|
104515
104597
|
return ret;
|
|
@@ -116810,7 +116892,9 @@ class SetHandlerTranspiler {
|
|
|
116810
116892
|
let eventClass = undefined;
|
|
116811
116893
|
let eventName = undefined;
|
|
116812
116894
|
for (const m of node.findDirectExpressions(abaplint.Expressions.MethodSource)) {
|
|
116813
|
-
|
|
116895
|
+
// the handler method is registered as a reference, it is dispatched dynamically when the event is raised,
|
|
116896
|
+
// so no static binding even if the SET HANDLER is inside a constructor
|
|
116897
|
+
const msource = new expressions_1.MethodSourceTranspiler("", true, false).transpile(m, traversal).getCode().replace("await ", "");
|
|
116814
116898
|
const lastDot = msource.lastIndexOf(".");
|
|
116815
116899
|
const receiver = lastDot === -1 ? "this" : msource.substring(0, lastDot);
|
|
116816
116900
|
methods.push(`{method: ${msource}, receiver: ${receiver}}`);
|
|
@@ -120585,6 +120669,12 @@ class Traversal {
|
|
|
120585
120669
|
static escapeNamespace(name) {
|
|
120586
120670
|
return name?.replace(/\//g, "$");
|
|
120587
120671
|
}
|
|
120672
|
+
/** the self reference "me", it is a FieldChain in eg. MethodCallChain and a SourceField in eg. MethodSource */
|
|
120673
|
+
static isMe(node) {
|
|
120674
|
+
return (node.get() instanceof abaplint.Expressions.FieldChain
|
|
120675
|
+
|| node.get() instanceof abaplint.Expressions.SourceField)
|
|
120676
|
+
&& node.concatTokens().toLowerCase() === "me";
|
|
120677
|
+
}
|
|
120588
120678
|
static prefixVariable(name) {
|
|
120589
120679
|
if (name && keywords_1.DEFAULT_KEYWORDS.has(name)) {
|
|
120590
120680
|
return "$" + name;
|
|
@@ -120916,6 +121006,57 @@ class Traversal {
|
|
|
120916
121006
|
}
|
|
120917
121007
|
return candidate;
|
|
120918
121008
|
}
|
|
121009
|
+
/** Returns the name of the class implementing the instance constructor the token is located in,
|
|
121010
|
+
* or undefined if the token is not inside an instance constructor.
|
|
121011
|
+
*
|
|
121012
|
+
* Only the constructor body itself counts, including nested scopes like FOR and LET. A method
|
|
121013
|
+
* called from the constructor is a scope of its own, and is not considered part of the constructor.
|
|
121014
|
+
*
|
|
121015
|
+
* This is cheap compared to resolving a method reference, so use it to bail out early. */
|
|
121016
|
+
enclosingConstructorClass(token) {
|
|
121017
|
+
let scope = this.findCurrentScopeByToken(token);
|
|
121018
|
+
// the token might be in a scope nested inside the method, eg. FOR or LET
|
|
121019
|
+
while (scope !== undefined && scope.getIdentifier().stype !== abaplint.ScopeType.Method) {
|
|
121020
|
+
if (scope.getIdentifier().stype === abaplint.ScopeType.ClassImplementation) {
|
|
121021
|
+
return undefined;
|
|
121022
|
+
}
|
|
121023
|
+
scope = scope.getParent();
|
|
121024
|
+
}
|
|
121025
|
+
if (scope === undefined || scope.getIdentifier().sname.toUpperCase() !== "CONSTRUCTOR") {
|
|
121026
|
+
return undefined;
|
|
121027
|
+
}
|
|
121028
|
+
while (scope !== undefined && scope.getIdentifier().stype !== abaplint.ScopeType.ClassImplementation) {
|
|
121029
|
+
scope = scope.getParent();
|
|
121030
|
+
}
|
|
121031
|
+
return scope?.getIdentifier().sname;
|
|
121032
|
+
}
|
|
121033
|
+
/** Methods called in an instance constructor are bound statically in ABAP, ie. a redefinition
|
|
121034
|
+
* in a sub class is not called. Returns the "{class}.prototype." prefix to call the method with,
|
|
121035
|
+
* or undefined if the normal dynamic dispatch via "this." is to be used.
|
|
121036
|
+
*
|
|
121037
|
+
* Note that the prefix is the class implementing the constructor, which is not necessarily the class
|
|
121038
|
+
* being constructed, nor the class defining the method. Eg. constructing a sub class runs the constructor
|
|
121039
|
+
* of the super class, and calls in there are bound to the super class. The JS prototype chain then finds
|
|
121040
|
+
* the implementation as seen from that class, and interface methods as they are implemented in the class.
|
|
121041
|
+
*
|
|
121042
|
+
* Only calls written directly in the constructor body are bound statically, see enclosingConstructorClass
|
|
121043
|
+
*
|
|
121044
|
+
* @param enclosingClass the result of enclosingConstructorClass(token), pass it if already resolved */
|
|
121045
|
+
constructorPrototypePrefix(token, def, enclosingClass) {
|
|
121046
|
+
if (def === undefined
|
|
121047
|
+
|| def.isStatic() === true
|
|
121048
|
+
|| def.getVisibility() === abaplint.Visibility.Private
|
|
121049
|
+
|| def.isAbstract() === true) {
|
|
121050
|
+
// static methods are not dispatched via the instance, and private methods cannot be redefined,
|
|
121051
|
+
// abstract methods have no implementation to bind to, so keep the dynamic dispatch
|
|
121052
|
+
return undefined;
|
|
121053
|
+
}
|
|
121054
|
+
const className = enclosingClass ?? this.enclosingConstructorClass(token);
|
|
121055
|
+
if (className === undefined) {
|
|
121056
|
+
return undefined;
|
|
121057
|
+
}
|
|
121058
|
+
return this.lookupClassOrInterface(className, token) + ".prototype.";
|
|
121059
|
+
}
|
|
120919
121060
|
isBuiltinVariable(token) {
|
|
120920
121061
|
const scope = this.findCurrentScopeByToken(token);
|
|
120921
121062
|
if (scope === undefined) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.57",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"author": "abaplint",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@abaplint/core": "^2.120.
|
|
31
|
-
"@abaplint/transpiler": "^2.13.
|
|
30
|
+
"@abaplint/core": "^2.120.22",
|
|
31
|
+
"@abaplint/transpiler": "^2.13.57",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
33
|
"@types/node": "^24.13.3",
|
|
34
34
|
"@types/progress": "^2.0.7",
|