@abaplint/runtime 2.0.3 → 2.0.4

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.
@@ -40,7 +40,9 @@ class Character {
40
40
  return this.value;
41
41
  }
42
42
  getOffset(input) {
43
- if (input.offset && input.offset >= this.length) {
43
+ if ((input.offset && input.offset >= this.length)
44
+ || (input.offset && input.offset < 0)
45
+ || (input.length && input.length < 0)) {
44
46
  // @ts-ignore
45
47
  if (abap.Classes["CX_SY_RANGE_OUT_OF_BOUNDS"] !== undefined) {
46
48
  // @ts-ignore
@@ -34,7 +34,9 @@ class String {
34
34
  return this.value;
35
35
  }
36
36
  getOffset(input) {
37
- if (input.offset && input.offset > this.value.length) {
37
+ if ((input.offset && input.offset > this.value.length)
38
+ || (input.offset && input.offset < 0)
39
+ || (input.length && input.length < 0)) {
38
40
  // @ts-ignore
39
41
  if (abap.Classes["CX_SY_RANGE_OUT_OF_BOUNDS"] !== undefined) {
40
42
  // @ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",