@abaplint/runtime 2.1.67 → 2.1.69
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.
|
@@ -5,7 +5,18 @@ const types_1 = require("../types");
|
|
|
5
5
|
const _parse_1 = require("./_parse");
|
|
6
6
|
// todo, this will only work when the target value is an integer?
|
|
7
7
|
function divide(left, right) {
|
|
8
|
-
const
|
|
8
|
+
const r = (0, _parse_1.parse)(right);
|
|
9
|
+
if (r === 0) {
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
if (abap.Classes["CX_SY_ZERODIVIDE"] !== undefined) {
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
throw new abap.Classes["CX_SY_ZERODIVIDE"]();
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
throw "Global class CX_SY_ZERODIVIDE not found";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const val = (0, _parse_1.parse)(left) / r;
|
|
9
20
|
return new types_1.Float().set(val);
|
|
10
21
|
}
|
|
11
22
|
exports.divide = divide;
|