@abaplint/transpiler-cli 2.6.33 → 2.6.35

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 +11 -5
  2. package/package.json +4 -4
package/build/bundle.js CHANGED
@@ -71725,6 +71725,7 @@ class CallFunctionTranspiler {
71725
71725
  if (fmchild instanceof abaplint.Nodes.ExpressionNode
71726
71726
  && fmchild.get() instanceof abaplint.Expressions.FieldChain) {
71727
71727
  fmname = new expressions_1.FieldChainTranspiler(true).transpile(fmchild, traversal).getCode();
71728
+ fmname = fmname + ".trimEnd()";
71728
71729
  }
71729
71730
  else {
71730
71731
  fmname = fmchild.concatTokens().toUpperCase();
@@ -72431,6 +72432,7 @@ exports.CreateObjectTranspiler = void 0;
72431
72432
  const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
72432
72433
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
72433
72434
  const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
72435
+ const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
72434
72436
  class CreateObjectTranspiler {
72435
72437
  transpile(node, traversal) {
72436
72438
  var _a, _b;
@@ -72445,7 +72447,7 @@ class CreateObjectTranspiler {
72445
72447
  let dynamic = (_a = node.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(abaplint.Expressions.ConstantString);
72446
72448
  if (dynamic) {
72447
72449
  name = dynamic.getFirstToken().getStr();
72448
- name = name.substring(1, name.length - 1);
72450
+ // name = name.substring(1, name.length - 1);
72449
72451
  }
72450
72452
  else {
72451
72453
  dynamic = (_b = node.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _b === void 0 ? void 0 : _b.findFirstExpression(abaplint.Expressions.FieldChain);
@@ -72458,10 +72460,14 @@ class CreateObjectTranspiler {
72458
72460
  name = this.findClassName(node, traversal);
72459
72461
  }
72460
72462
  let ret = "";
72461
- const clas = traversal.lookupClassOrInterface(name, node.getFirstToken(), directGlobal);
72463
+ let clas = traversal.lookupClassOrInterface(name, node.getFirstToken(), directGlobal);
72462
72464
  const cx = traversal.lookupClassOrInterface("CX_SY_CREATE_OBJECT_ERROR", node.getFirstToken());
72463
72465
  if (dynamic) {
72464
- ret += `if (${clas} === undefined) { throw new ${cx}; }\n`;
72466
+ const id = unique_identifier_1.UniqueIdentifier.get();
72467
+ ret += `let ${id} = abap.Classes["${traversal.buildPrefix()}"+${name}.trimEnd()];\n`;
72468
+ ret += `if (${id} === undefined) { ${id} = abap.Classes[${name}.trimEnd()]; }\n`;
72469
+ ret += `if (${id} === undefined) { throw new ${cx}; }\n`;
72470
+ clas = id;
72465
72471
  }
72466
72472
  ret += target + ".set(await (new " + clas + "()).constructor_(" + para + "));";
72467
72473
  return new chunk_1.Chunk(ret);
@@ -78240,7 +78246,7 @@ class Traversal {
78240
78246
  if (def) {
78241
78247
  if (def.isGlobal() === false) {
78242
78248
  const prefix = this.buildPrefix();
78243
- return `${prefix}-${(_a = def === null || def === void 0 ? void 0 : def.getName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()}`;
78249
+ return `${prefix}${(_a = def === null || def === void 0 ? void 0 : def.getName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()}`;
78244
78250
  }
78245
78251
  else {
78246
78252
  return (_b = def === null || def === void 0 ? void 0 : def.getName()) === null || _b === void 0 ? void 0 : _b.toUpperCase();
@@ -78265,7 +78271,7 @@ class Traversal {
78265
78271
  return "abap.Classes['" + internalName + "']";
78266
78272
  }
78267
78273
  buildPrefix() {
78268
- return this.obj.getType() + "-" + this.obj.getName();
78274
+ return this.obj.getType() + "-" + this.obj.getName() + "-";
78269
78275
  }
78270
78276
  ////////////////////////////
78271
78277
  traverseStructure(node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.6.33",
3
+ "version": "2.6.35",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,14 +25,14 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.6.33",
28
+ "@abaplint/transpiler": "^2.6.35",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",
32
- "@types/node": "^18.16.0",
32
+ "@types/node": "^18.16.1",
33
33
  "@abaplint/core": "^2.97.17",
34
34
  "progress": "^2.0.3",
35
- "webpack": "^5.80.0",
35
+ "webpack": "^5.81.0",
36
36
  "webpack-cli": "^5.0.2",
37
37
  "typescript": "^5.0.4"
38
38
  }