@abaplint/runtime 2.7.65 → 2.7.67

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.
@@ -8,7 +8,7 @@ function throwError(name) {
8
8
  throw new abap.Classes[name]();
9
9
  }
10
10
  else {
11
- throw `Global class ${name} not found`;
11
+ throw new Error(`Global class ${name} not found`);
12
12
  }
13
13
  }
14
14
  exports.throwError = throwError;
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Packed = void 0;
4
4
  const float_1 = require("./float");
5
+ const throw_error_1 = require("../throw_error");
6
+ const digits = new RegExp(/^\s*-?\+?\d+\.?\d* *$/i);
5
7
  class Packed {
6
8
  constructor(input) {
7
9
  this.value = 0;
@@ -27,6 +29,9 @@ class Packed {
27
29
  this.value = value;
28
30
  }
29
31
  else if (typeof value === "string") {
32
+ if (digits.test(value) === false) {
33
+ (0, throw_error_1.throwError)("CX_SY_CONVERSION_NO_NUMBER");
34
+ }
30
35
  this.value = this.round(parseFloat(value), this.decimals);
31
36
  }
32
37
  else if (value instanceof float_1.Float) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.7.65",
3
+ "version": "2.7.67",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",