@abaplint/runtime 2.7.161 → 2.7.162
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/src/types/table.js +19 -3
- package/package.json +1 -1
package/build/src/types/table.js
CHANGED
|
@@ -9,6 +9,8 @@ const field_symbol_1 = require("./field_symbol");
|
|
|
9
9
|
const data_reference_1 = require("./data_reference");
|
|
10
10
|
const insert_internal_1 = require("../statements/insert_internal");
|
|
11
11
|
const sort_1 = require("../statements/sort");
|
|
12
|
+
const character_1 = require("./character");
|
|
13
|
+
const hex_1 = require("./hex");
|
|
12
14
|
// const FEATURE_SHARED_TABLES = true;
|
|
13
15
|
var TableAccessType;
|
|
14
16
|
(function (TableAccessType) {
|
|
@@ -144,9 +146,23 @@ class HashedTable {
|
|
|
144
146
|
val = rowType.get();
|
|
145
147
|
}
|
|
146
148
|
else if (ttyp instanceof structure_1.Structure) {
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
val
|
|
149
|
+
const field = ttyp.get()[k.toLowerCase()];
|
|
150
|
+
// if types match, there is no need to clone
|
|
151
|
+
if (field instanceof string_1.String && val instanceof string_1.String) {
|
|
152
|
+
val = val.get();
|
|
153
|
+
}
|
|
154
|
+
else if (field instanceof character_1.Character && val instanceof character_1.Character && field.getLength() === val.getLength()) {
|
|
155
|
+
val = val.get();
|
|
156
|
+
}
|
|
157
|
+
else if (field instanceof hex_1.Hex && val instanceof hex_1.Hex && field.getLength() === val.getLength()) {
|
|
158
|
+
val = val.get();
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
// convert
|
|
162
|
+
const rowType = (0, clone_1.clone)(field);
|
|
163
|
+
rowType.set(val.get());
|
|
164
|
+
val = rowType.get();
|
|
165
|
+
}
|
|
150
166
|
}
|
|
151
167
|
else {
|
|
152
168
|
throw new Error("HashedTable, buildHashFromSimple, unexpected type");
|