@abaplint/runtime 2.13.76 → 2.13.78

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.
@@ -60,8 +60,13 @@ function assign(input) {
60
60
  const componentName = sourceContainer instanceof types_1.Structure
61
61
  ? s.toLowerCase()
62
62
  : s.toLowerCase().replace(/[~\\/]/g, "$");
63
+ let next = source[componentName];
64
+ if (next === undefined && source.FRIENDS_ACCESS_INSTANCE !== undefined) {
65
+ // it might be private, note this currently does not respect encapsulation properly
66
+ next = source.FRIENDS_ACCESS_INSTANCE[componentName];
67
+ }
63
68
  // @ts-ignore
64
- input.dynamicSource = source[componentName];
69
+ input.dynamicSource = next;
65
70
  }
66
71
  }
67
72
  }
@@ -30,5 +30,6 @@ export declare class FieldSymbol {
30
30
  offset?: number | INumeric | Hex;
31
31
  length?: number | INumeric | Hex;
32
32
  }): any;
33
+ private needsReinterpretation;
33
34
  }
34
35
  export {};
@@ -7,6 +7,7 @@ const hex_1 = require("./hex");
7
7
  const float_1 = require("./float");
8
8
  const data_reference_1 = require("./data_reference");
9
9
  const hex_uint8_1 = require("./hex_uint8");
10
+ const date_1 = require("./date");
10
11
  class FieldSymbol {
11
12
  pointer;
12
13
  casting;
@@ -39,7 +40,7 @@ class FieldSymbol {
39
40
  return this.pointer !== undefined;
40
41
  }
41
42
  getPointer() {
42
- if (this.casting) {
43
+ if (this.needsReinterpretation()) {
43
44
  // todo, this wont work for everything, eg changing CASTING'ed values
44
45
  return this.get();
45
46
  }
@@ -58,7 +59,7 @@ class FieldSymbol {
58
59
  return this.pointer?.clear();
59
60
  }
60
61
  get() {
61
- if (this.casting) {
62
+ if (this.needsReinterpretation()) {
62
63
  if (this.type instanceof hex_1.Hex || this.type instanceof hex_uint8_1.HexUInt8) {
63
64
  const pt = this.pointer;
64
65
  if (pt instanceof float_1.Float) {
@@ -96,7 +97,7 @@ class FieldSymbol {
96
97
  return this.pointer?.getArrayLength();
97
98
  }
98
99
  set(value) {
99
- if (this.casting) {
100
+ if (this.needsReinterpretation()) {
100
101
  if (this.type instanceof hex_1.Hex || this.type instanceof hex_uint8_1.HexUInt8) {
101
102
  const pt = this.pointer;
102
103
  if (pt instanceof float_1.Float) {
@@ -112,6 +113,11 @@ class FieldSymbol {
112
113
  getOffset(input) {
113
114
  return this.getPointer().getOffset(input);
114
115
  }
116
+ needsReinterpretation() {
117
+ // Date-to-date CASTING shares the original storage and must retain the Date
118
+ // wrapper so arithmetic uses day counts instead of parsing YYYYMMDD as a number.
119
+ return this.casting && !(this.type instanceof date_1.Date && this.pointer instanceof date_1.Date);
120
+ }
115
121
  }
116
122
  exports.FieldSymbol = FieldSymbol;
117
123
  //# sourceMappingURL=field_symbol.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.13.76",
3
+ "version": "2.13.78",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -29,15 +29,15 @@
29
29
  "author": "abaplint",
30
30
  "license": "MIT",
31
31
  "devDependencies": {
32
- "@types/chai": "^4.3.20",
32
+ "@types/chai": "^5.2.3",
33
33
  "@types/mocha": "^10.0.10",
34
- "@types/node": "^24.13.3",
35
- "chai": "^4.5.0",
36
- "mocha": "^11.8.0",
34
+ "@types/node": "^26.4.1",
35
+ "chai": "^6.2.2",
36
+ "mocha": "^12.0.0",
37
37
  "source-map-support": "^0.5.21",
38
38
  "typescript": "^6.0.3"
39
39
  },
40
40
  "dependencies": {
41
- "temporal-polyfill": "^0.3.2"
41
+ "temporal-polyfill": "^1.0.4"
42
42
  }
43
43
  }