@abaplint/transpiler 2.13.22 → 2.13.23
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/statements/assign.js +19 -19
- package/package.json +2 -2
|
@@ -10,15 +10,15 @@ class AssignTranspiler {
|
|
|
10
10
|
if (node?.findFirstExpression(abaplint.Expressions.TableExpression) === undefined) {
|
|
11
11
|
return code;
|
|
12
12
|
}
|
|
13
|
-
return `(await (async () => {
|
|
14
|
-
try {
|
|
15
|
-
return ${code};
|
|
16
|
-
} catch (error) {
|
|
17
|
-
if (abap.isLineNotFound(error)) {
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
throw error;
|
|
21
|
-
}
|
|
13
|
+
return `(await (async () => {
|
|
14
|
+
try {
|
|
15
|
+
return ${code};
|
|
16
|
+
} catch (error) {
|
|
17
|
+
if (abap.isLineNotFound(error)) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
22
|
})())`;
|
|
23
23
|
}
|
|
24
24
|
transpile(node, traversal) {
|
|
@@ -101,26 +101,26 @@ class AssignTranspiler {
|
|
|
101
101
|
const firstFirst = first.getChildren()[1];
|
|
102
102
|
if (firstFirst?.get() instanceof abaplint.Expressions.Constant) {
|
|
103
103
|
const s = firstFirst.getFirstToken().getStr().toLowerCase().match(/\w+/)?.toString();
|
|
104
|
-
options.push(`dynamicSource: (() => {
|
|
105
|
-
try { return ${s}; } catch {}
|
|
106
|
-
try { return this.${s}; } catch {}
|
|
104
|
+
options.push(`dynamicSource: (() => {
|
|
105
|
+
try { return ${s}; } catch {}
|
|
106
|
+
try { return this.${s}; } catch {}
|
|
107
107
|
})()`);
|
|
108
108
|
}
|
|
109
109
|
else if (firstFirst?.get() instanceof abaplint.Expressions.FieldChain && firstFirst instanceof abaplint.Nodes.ExpressionNode) {
|
|
110
110
|
const code = new expressions_1.FieldChainTranspiler(true).transpile(firstFirst, traversal).getCode();
|
|
111
|
-
options.push(`dynamicSource: (() => {
|
|
112
|
-
const name = ${code}.toLowerCase().replace(/[~\\/]/g, "$").match(/[\\w\\$\\/]+/)[0];
|
|
113
|
-
try { return eval(name); } catch {}
|
|
114
|
-
try { return eval("this." + name); } catch {}
|
|
111
|
+
options.push(`dynamicSource: (() => {
|
|
112
|
+
const name = ${code}.toLowerCase().replace(/[~\\/]/g, "$").match(/[\\w\\$\\/]+/)[0];
|
|
113
|
+
try { return eval(name); } catch {}
|
|
114
|
+
try { return eval("this." + name); } catch {}
|
|
115
115
|
})()`);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
else if (first?.get() instanceof abaplint.Expressions.Source && first instanceof abaplint.Nodes.ExpressionNode) {
|
|
119
119
|
// const name = first.concatTokens().toLowerCase();
|
|
120
120
|
const name = new expressions_1.SourceTranspiler().transpile(first, traversal).getCode();
|
|
121
|
-
options.push(`dynamicSource: (() => {
|
|
122
|
-
try { return ${name}; } catch {}
|
|
123
|
-
try { return this.${name}; } catch {}
|
|
121
|
+
options.push(`dynamicSource: (() => {
|
|
122
|
+
try { return ${name}; } catch {}
|
|
123
|
+
try { return this.${name}; } catch {}
|
|
124
124
|
})()`);
|
|
125
125
|
}
|
|
126
126
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.23",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"author": "abaplint",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@abaplint/core": "^2.119.
|
|
32
|
+
"@abaplint/core": "^2.119.16",
|
|
33
33
|
"source-map": "^0.7.6"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|