From 3e8b9fe3e914becec0247796f6830edd4a9db19b Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Mon, 9 Sep 2024 18:12:47 +0200 Subject: [PATCH 1/4] bugfix --- package-lock.json | 14 ++++++------- package.json | 2 +- packages/cli/package-lock.json | 14 ++++++------- packages/cli/package.json | 2 +- packages/transpiler/package-lock.json | 14 ++++++------- packages/transpiler/package.json | 2 +- test/statements/create_data.ts | 29 +++++++++++++++++++++++++++ 7 files changed, 53 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index db3ff432b..3903d0aa9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "MIT", "devDependencies": { - "@abaplint/core": "^2.113.6", + "@abaplint/core": "^2.113.7", "@types/chai": "^4.3.19", "@types/mocha": "^10.0.7", "@types/node": "^22.5.4", @@ -43,9 +43,9 @@ } }, "node_modules/@abaplint/core": { - "version": "2.113.6", - "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.6.tgz", - "integrity": "sha512-jctPSwZAqlY5pmxaqf3xZRRmadvGwpZY51rXPplaWPjxKP6jm3ZcRfOTZfYUvKRSk0Nq28rSGiE9Y9kOKeKJbw==", + "version": "2.113.7", + "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.7.tgz", + "integrity": "sha512-vyHV/A9DJOi+/9TUknMg94BR9ivHVpiQZ2ox5FiVlj4rJ5eaTZqHvZ+rvFFjI66ADt158gGIvu1+tiIIsUXqzA==", "dev": true, "dependencies": { "fast-xml-parser": "^4.5.0", @@ -7098,9 +7098,9 @@ "dev": true }, "@abaplint/core": { - "version": "2.113.6", - "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.6.tgz", - "integrity": "sha512-jctPSwZAqlY5pmxaqf3xZRRmadvGwpZY51rXPplaWPjxKP6jm3ZcRfOTZfYUvKRSk0Nq28rSGiE9Y9kOKeKJbw==", + "version": "2.113.7", + "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.7.tgz", + "integrity": "sha512-vyHV/A9DJOi+/9TUknMg94BR9ivHVpiQZ2ox5FiVlj4rJ5eaTZqHvZ+rvFFjI66ADt158gGIvu1+tiIIsUXqzA==", "dev": true, "requires": { "fast-xml-parser": "^4.5.0", diff --git a/package.json b/package.json index 8b4bf2a55..0359aa266 100644 --- a/package.json +++ b/package.json @@ -186,7 +186,7 @@ }, "homepage": "https://github.com/abaplint/transpiler_poc#readme", "devDependencies": { - "@abaplint/core": "^2.113.6", + "@abaplint/core": "^2.113.7", "@types/chai": "^4.3.19", "@types/mocha": "^10.0.7", "@types/node": "^22.5.4", diff --git a/packages/cli/package-lock.json b/packages/cli/package-lock.json index 2bc6bc51f..84ed8d58c 100644 --- a/packages/cli/package-lock.json +++ b/packages/cli/package-lock.json @@ -12,7 +12,7 @@ "abap_transpile": "abap_transpile" }, "devDependencies": { - "@abaplint/core": "^2.113.6", + "@abaplint/core": "^2.113.7", "@abaplint/transpiler": "^2.10.17", "@types/glob": "^8.1.0", "@types/node": "^22.5.4", @@ -28,9 +28,9 @@ } }, "node_modules/@abaplint/core": { - "version": "2.113.6", - "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.6.tgz", - "integrity": "sha512-jctPSwZAqlY5pmxaqf3xZRRmadvGwpZY51rXPplaWPjxKP6jm3ZcRfOTZfYUvKRSk0Nq28rSGiE9Y9kOKeKJbw==", + "version": "2.113.7", + "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.7.tgz", + "integrity": "sha512-vyHV/A9DJOi+/9TUknMg94BR9ivHVpiQZ2ox5FiVlj4rJ5eaTZqHvZ+rvFFjI66ADt158gGIvu1+tiIIsUXqzA==", "dev": true, "dependencies": { "fast-xml-parser": "^4.5.0", @@ -1566,9 +1566,9 @@ }, "dependencies": { "@abaplint/core": { - "version": "2.113.6", - "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.6.tgz", - "integrity": "sha512-jctPSwZAqlY5pmxaqf3xZRRmadvGwpZY51rXPplaWPjxKP6jm3ZcRfOTZfYUvKRSk0Nq28rSGiE9Y9kOKeKJbw==", + "version": "2.113.7", + "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.7.tgz", + "integrity": "sha512-vyHV/A9DJOi+/9TUknMg94BR9ivHVpiQZ2ox5FiVlj4rJ5eaTZqHvZ+rvFFjI66ADt158gGIvu1+tiIIsUXqzA==", "dev": true, "requires": { "fast-xml-parser": "^4.5.0", diff --git a/packages/cli/package.json b/packages/cli/package.json index 517446190..778e60f7b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -31,7 +31,7 @@ "glob": "=7.2.0", "@types/progress": "^2.0.7", "@types/node": "^22.5.4", - "@abaplint/core": "^2.113.6", + "@abaplint/core": "^2.113.7", "progress": "^2.0.3", "webpack": "^5.94.0", "webpack-cli": "^5.1.4", diff --git a/packages/transpiler/package-lock.json b/packages/transpiler/package-lock.json index e07f2922a..d0050e6f0 100644 --- a/packages/transpiler/package-lock.json +++ b/packages/transpiler/package-lock.json @@ -9,7 +9,7 @@ "version": "2.10.17", "license": "MIT", "dependencies": { - "@abaplint/core": "^2.113.6", + "@abaplint/core": "^2.113.7", "source-map": "^0.7.4" }, "devDependencies": { @@ -25,9 +25,9 @@ } }, "node_modules/@abaplint/core": { - "version": "2.113.6", - "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.6.tgz", - "integrity": "sha512-jctPSwZAqlY5pmxaqf3xZRRmadvGwpZY51rXPplaWPjxKP6jm3ZcRfOTZfYUvKRSk0Nq28rSGiE9Y9kOKeKJbw==", + "version": "2.113.7", + "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.7.tgz", + "integrity": "sha512-vyHV/A9DJOi+/9TUknMg94BR9ivHVpiQZ2ox5FiVlj4rJ5eaTZqHvZ+rvFFjI66ADt158gGIvu1+tiIIsUXqzA==", "dependencies": { "fast-xml-parser": "^4.5.0", "json5": "^2.2.3", @@ -1075,9 +1075,9 @@ }, "dependencies": { "@abaplint/core": { - "version": "2.113.6", - "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.6.tgz", - "integrity": "sha512-jctPSwZAqlY5pmxaqf3xZRRmadvGwpZY51rXPplaWPjxKP6jm3ZcRfOTZfYUvKRSk0Nq28rSGiE9Y9kOKeKJbw==", + "version": "2.113.7", + "resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.113.7.tgz", + "integrity": "sha512-vyHV/A9DJOi+/9TUknMg94BR9ivHVpiQZ2ox5FiVlj4rJ5eaTZqHvZ+rvFFjI66ADt158gGIvu1+tiIIsUXqzA==", "requires": { "fast-xml-parser": "^4.5.0", "json5": "^2.2.3", diff --git a/packages/transpiler/package.json b/packages/transpiler/package.json index 878699e3e..4ff73b643 100644 --- a/packages/transpiler/package.json +++ b/packages/transpiler/package.json @@ -29,7 +29,7 @@ "author": "abaplint", "license": "MIT", "dependencies": { - "@abaplint/core": "^2.113.6", + "@abaplint/core": "^2.113.7", "source-map": "^0.7.4" }, "devDependencies": { diff --git a/test/statements/create_data.ts b/test/statements/create_data.ts index 8f32643fc..0bdac55e7 100644 --- a/test/statements/create_data.ts +++ b/test/statements/create_data.ts @@ -344,4 +344,33 @@ ASSIGN ref_int8->* TO . const f = new AsyncFunction("abap", js); await f(abap); }); + + it.skip("CREATE DATA, like and inputs and field symbols", async () => { + const code = ` +CLASS lcl DEFINITION. + PUBLIC SECTION. + METHODS set_cell IMPORTING ip_value TYPE simple OPTIONAL. +ENDCLASS. + +CLASS lcl IMPLEMENTATION. + METHOD set_cell. + DATA lo_value TYPE REF TO data. + FIELD-SYMBOLS TYPE simple. + + CREATE DATA lo_value LIKE ip_value. + ASSIGN lo_value->* TO . + = ip_value. + WRITE / . + ENDMETHOD. +ENDCLASS. + +START-OF-SELECTION. + DATA lo TYPE REF TO lcl. + CREATE OBJECT lo. + lo->set_cell( 2 ).`; + const js = await run(code); + const f = new AsyncFunction("abap", js); + await f(abap); + expect(abap.console.get()).to.equal("2"); + }); }); From 8e1959e1e70c9de3b54a3950ad303a1935ecc0d8 Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Mon, 9 Sep 2024 18:13:31 +0200 Subject: [PATCH 2/4] run test --- test/statements/create_data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/statements/create_data.ts b/test/statements/create_data.ts index 0bdac55e7..b37c130d6 100644 --- a/test/statements/create_data.ts +++ b/test/statements/create_data.ts @@ -345,7 +345,7 @@ ASSIGN ref_int8->* TO . await f(abap); }); - it.skip("CREATE DATA, like and inputs and field symbols", async () => { + it.only("CREATE DATA, like and inputs and field symbols", async () => { const code = ` CLASS lcl DEFINITION. PUBLIC SECTION. From a3cc6dcafb338a3905c291b79327c204d1250693 Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Mon, 9 Sep 2024 18:16:29 +0200 Subject: [PATCH 3/4] bugfix --- packages/runtime/src/clone.ts | 9 +++------ test/statements/create_data.ts | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/runtime/src/clone.ts b/packages/runtime/src/clone.ts index aff4eda4d..ab75c2a2f 100644 --- a/packages/runtime/src/clone.ts +++ b/packages/runtime/src/clone.ts @@ -28,12 +28,6 @@ export function clone(obj: T): T { // @ts-ignore // eslint-disable-next-line no-prototype-builtins if (obj.hasOwnProperty(attr)) { - /* - if (null === obj[attr]) { - console.dir("null"); - copy[attr] = null; - } else - */ if ("object" !== typeof obj[attr]) { copy[attr] = obj[attr]; } else { @@ -41,5 +35,8 @@ export function clone(obj: T): T { } } } + if (copy["constant"]) { + copy["constant"] = false; + } return copy; } \ No newline at end of file diff --git a/test/statements/create_data.ts b/test/statements/create_data.ts index b37c130d6..a111f3826 100644 --- a/test/statements/create_data.ts +++ b/test/statements/create_data.ts @@ -345,7 +345,7 @@ ASSIGN ref_int8->* TO . await f(abap); }); - it.only("CREATE DATA, like and inputs and field symbols", async () => { + it("CREATE DATA, like and inputs and field symbols", async () => { const code = ` CLASS lcl DEFINITION. PUBLIC SECTION. From 472439ecd4a978d24a9743ea3e346111b83264a5 Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Mon, 9 Sep 2024 18:45:58 +0200 Subject: [PATCH 4/4] 2.10.18 --- packages/cli/package-lock.json | 36 +++++++++++++-------------- packages/cli/package.json | 6 ++--- packages/runtime/package-lock.json | 4 +-- packages/runtime/package.json | 2 +- packages/transpiler/package-lock.json | 4 +-- packages/transpiler/package.json | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/cli/package-lock.json b/packages/cli/package-lock.json index 84ed8d58c..3ff909fb9 100644 --- a/packages/cli/package-lock.json +++ b/packages/cli/package-lock.json @@ -1,25 +1,25 @@ { "name": "@abaplint/transpiler-cli", - "version": "2.10.17", + "version": "2.10.18", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@abaplint/transpiler-cli", - "version": "2.10.17", + "version": "2.10.18", "license": "MIT", "bin": { "abap_transpile": "abap_transpile" }, "devDependencies": { "@abaplint/core": "^2.113.7", - "@abaplint/transpiler": "^2.10.17", + "@abaplint/transpiler": "^2.10.18", "@types/glob": "^8.1.0", "@types/node": "^22.5.4", "@types/progress": "^2.0.7", "glob": "=7.2.0", "progress": "^2.0.3", - "typescript": "^5.5.4", + "typescript": "^5.6.2", "webpack": "^5.94.0", "webpack-cli": "^5.1.4" }, @@ -45,12 +45,12 @@ } }, "node_modules/@abaplint/transpiler": { - "version": "2.10.17", - "resolved": "https://registry.npmjs.org/@abaplint/transpiler/-/transpiler-2.10.17.tgz", - "integrity": "sha512-AWwCyk0eOUj0ldcDzMFwfMKFgLvO/hHR3nT1HY01H9XZ5Liq8mDpMU7sAhXzR6MlaSMG0FtGmthErJYn07/KdQ==", + "version": "2.10.18", + "resolved": "https://registry.npmjs.org/@abaplint/transpiler/-/transpiler-2.10.18.tgz", + "integrity": "sha512-5X0669N/QGDjhg+VoE3xs29p0nIaOnXf2vt14bPzT0+3cFKuZSCnGLwRDY2zGDACbvLVm08JYVmz9CyUEyYKlA==", "dev": true, "dependencies": { - "@abaplint/core": "^2.113.6", + "@abaplint/core": "^2.113.7", "source-map": "^0.7.4" }, "funding": { @@ -1338,9 +1338,9 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1577,12 +1577,12 @@ } }, "@abaplint/transpiler": { - "version": "2.10.17", - "resolved": "https://registry.npmjs.org/@abaplint/transpiler/-/transpiler-2.10.17.tgz", - "integrity": "sha512-AWwCyk0eOUj0ldcDzMFwfMKFgLvO/hHR3nT1HY01H9XZ5Liq8mDpMU7sAhXzR6MlaSMG0FtGmthErJYn07/KdQ==", + "version": "2.10.18", + "resolved": "https://registry.npmjs.org/@abaplint/transpiler/-/transpiler-2.10.18.tgz", + "integrity": "sha512-5X0669N/QGDjhg+VoE3xs29p0nIaOnXf2vt14bPzT0+3cFKuZSCnGLwRDY2zGDACbvLVm08JYVmz9CyUEyYKlA==", "dev": true, "requires": { - "@abaplint/core": "^2.113.6", + "@abaplint/core": "^2.113.7", "source-map": "^0.7.4" } }, @@ -2558,9 +2558,9 @@ } }, "typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true }, "undici-types": { diff --git a/packages/cli/package.json b/packages/cli/package.json index 778e60f7b..6f39d150f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@abaplint/transpiler-cli", - "version": "2.10.17", + "version": "2.10.18", "description": "Transpiler - Command Line Interface", "funding": "https://github.com/sponsors/larshp", "bin": { @@ -26,7 +26,7 @@ "author": "abaplint", "license": "MIT", "devDependencies": { - "@abaplint/transpiler": "^2.10.17", + "@abaplint/transpiler": "^2.10.18", "@types/glob": "^8.1.0", "glob": "=7.2.0", "@types/progress": "^2.0.7", @@ -35,6 +35,6 @@ "progress": "^2.0.3", "webpack": "^5.94.0", "webpack-cli": "^5.1.4", - "typescript": "^5.5.4" + "typescript": "^5.6.2" } } diff --git a/packages/runtime/package-lock.json b/packages/runtime/package-lock.json index e4129aab5..158e0827e 100644 --- a/packages/runtime/package-lock.json +++ b/packages/runtime/package-lock.json @@ -1,12 +1,12 @@ { "name": "@abaplint/runtime", - "version": "2.10.17", + "version": "2.10.18", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@abaplint/runtime", - "version": "2.10.17", + "version": "2.10.18", "license": "MIT", "dependencies": { "temporal-polyfill": "^0.2.5" diff --git a/packages/runtime/package.json b/packages/runtime/package.json index 94c1d41a5..daecd4cad 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@abaplint/runtime", - "version": "2.10.17", + "version": "2.10.18", "description": "Transpiler - Runtime", "main": "build/src/index.js", "typings": "build/src/index.d.ts", diff --git a/packages/transpiler/package-lock.json b/packages/transpiler/package-lock.json index d0050e6f0..b0b36dccf 100644 --- a/packages/transpiler/package-lock.json +++ b/packages/transpiler/package-lock.json @@ -1,12 +1,12 @@ { "name": "@abaplint/transpiler", - "version": "2.10.17", + "version": "2.10.18", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@abaplint/transpiler", - "version": "2.10.17", + "version": "2.10.18", "license": "MIT", "dependencies": { "@abaplint/core": "^2.113.7", diff --git a/packages/transpiler/package.json b/packages/transpiler/package.json index 4ff73b643..d4ff8112f 100644 --- a/packages/transpiler/package.json +++ b/packages/transpiler/package.json @@ -1,6 +1,6 @@ { "name": "@abaplint/transpiler", - "version": "2.10.17", + "version": "2.10.18", "description": "Transpiler", "main": "build/src/index.js", "typings": "build/src/index.d.ts",