@abaplint/transpiler 2.6.16 → 2.6.17

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.
@@ -46,7 +46,7 @@ class Chunk {
46
46
  const lines = this.raw.split("\n");
47
47
  const lineCount = lines.length;
48
48
  const lastLine = lines[lines.length - 1];
49
- append.mappings.forEach(m => {
49
+ for (const m of append.mappings) {
50
50
  // original stays the same, but adjust the generated positions
51
51
  const add = m;
52
52
  if (add.generated.line === 1 && this.raw.endsWith("\n") === false) {
@@ -56,7 +56,7 @@ class Chunk {
56
56
  add.generated.line += lineCount - 1;
57
57
  }
58
58
  this.mappings.push(add);
59
- });
59
+ }
60
60
  this.raw += append.getCode();
61
61
  return this;
62
62
  }
@@ -460,7 +460,7 @@ class Traversal {
460
460
  }
461
461
  const name = def.getName();
462
462
  if (def.isGlobal() === false) {
463
- const prefix = this.buildPrefix(def);
463
+ const prefix = this.buildPrefix();
464
464
  return `abap.Classes['${prefix}-${name.toUpperCase()}'] = ${Traversal.escapeNamespace(name.toLowerCase())};`;
465
465
  }
466
466
  else {
@@ -506,7 +506,7 @@ class Traversal {
506
506
  }
507
507
  if (def) {
508
508
  if (def.isGlobal() === false) {
509
- const prefix = this.buildPrefix(def);
509
+ const prefix = this.buildPrefix();
510
510
  return `abap.Classes['${prefix}-${(_a = def === null || def === void 0 ? void 0 : def.getName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()}']`;
511
511
  }
512
512
  else {
@@ -518,13 +518,8 @@ class Traversal {
518
518
  return "abap.Classes['" + name.toUpperCase() + "']";
519
519
  }
520
520
  }
521
- buildPrefix(def) {
522
- const file = this.reg.getFileByName(def.getFilename());
523
- if (file === undefined) {
524
- return "NOT_FOUND";
525
- }
526
- const obj = this.reg.findObjectForFile(file);
527
- return (obj === null || obj === void 0 ? void 0 : obj.getType()) + "-" + (obj === null || obj === void 0 ? void 0 : obj.getName());
521
+ buildPrefix() {
522
+ return this.obj.getType() + "-" + this.obj.getName();
528
523
  }
529
524
  ////////////////////////////
530
525
  traverseStructure(node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.6.16",
3
+ "version": "2.6.17",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "author": "abaplint",
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "@abaplint/core": "^2.97.10",
31
+ "@abaplint/core": "^2.97.12",
32
32
  "source-map": "^0.7.4"
33
33
  },
34
34
  "devDependencies": {