Skip to content

Commit e957281

Browse files
Ignore file with EMSCRIPTEN code
1 parent b72b63d commit e957281

File tree

3 files changed

+38
-21
lines changed

3 files changed

+38
-21
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ const createJSAst = async (options) => {
305305
}
306306

307307
for (const file of srcFiles) {
308+
if (fs.readFileSync(file, "utf-8").toString().includes("// EMSCRIPTEN_START_ASM")) {
309+
console.warn("Parsing", file, ":", "File skipped as it contains EMSCRIPTEN code");
310+
continue;
311+
}
308312
try {
309313
const ast = fileToJsAst(file);
310314
writeAstFile(file, ast, options);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@joernio/astgen",
3-
"version": "3.15.0",
3+
"version": "3.16.0",
44
"description": "Generate JS/TS AST in json format with Babel",
55
"exports": "./index.js",
66
"keywords": [

yarn.lock

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121
resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz"
2222
integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==
2323

24+
"@babel/parser@^7.24.7":
25+
version "7.24.7"
26+
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz"
27+
integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==
28+
2429
2530
version "7.18.4"
2631
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.18.4.tgz"
2732
integrity sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow==
2833

29-
"@babel/parser@^7.22.10":
30-
version "7.22.10"
31-
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.10.tgz#e37634f9a12a1716136c44624ef54283cabd3f55"
32-
integrity sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==
33-
34-
"@babel/[email protected]", "@babel/types@^7.18.2":
34+
"@babel/types@^7.18.2", "@babel/[email protected]":
3535
version "7.19.0"
3636
resolved "https://registry.npmjs.org/@babel/types/-/types-7.19.0.tgz"
3737
integrity sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==
@@ -80,7 +80,7 @@
8080
"@nodelib/fs.stat" "2.0.5"
8181
run-parallel "^1.1.9"
8282

83-
"@nodelib/[email protected].5", "@nodelib/fs.stat@^2.0.2":
83+
"@nodelib/fs.stat@^2.0.2", "@nodelib/[email protected].5":
8484
version "2.0.5"
8585
resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz"
8686
integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==
@@ -403,7 +403,7 @@ into-stream@^6.0.0:
403403
from2 "^2.3.0"
404404
p-is-promise "^3.0.0"
405405

406-
[email protected], is-core-module@^2.9.0:
406+
is-core-module@^2.9.0, [email protected]:
407407
version "2.9.0"
408408
resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz"
409409
integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==
@@ -640,7 +640,20 @@ rc@^1.2.7:
640640
minimist "^1.2.0"
641641
strip-json-comments "~2.0.1"
642642

643-
readable-stream@^2.0.0, readable-stream@^2.1.4:
643+
readable-stream@^2.0.0:
644+
version "2.3.7"
645+
resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz"
646+
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
647+
dependencies:
648+
core-util-is "~1.0.0"
649+
inherits "~2.0.3"
650+
isarray "~1.0.0"
651+
process-nextick-args "~2.0.0"
652+
safe-buffer "~5.1.1"
653+
string_decoder "~1.1.1"
654+
util-deprecate "~1.0.1"
655+
656+
readable-stream@^2.1.4:
644657
version "2.3.7"
645658
resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz"
646659
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
@@ -738,6 +751,13 @@ stream-meter@^1.0.4:
738751
dependencies:
739752
readable-stream "^2.1.4"
740753

754+
string_decoder@^1.1.1, string_decoder@~1.1.1:
755+
version "1.1.1"
756+
resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz"
757+
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
758+
dependencies:
759+
safe-buffer "~5.1.0"
760+
741761
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
742762
version "4.2.3"
743763
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
@@ -747,13 +767,6 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
747767
is-fullwidth-code-point "^3.0.0"
748768
strip-ansi "^6.0.1"
749769

750-
string_decoder@^1.1.1, string_decoder@~1.1.1:
751-
version "1.1.1"
752-
resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz"
753-
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
754-
dependencies:
755-
safe-buffer "~5.1.0"
756-
757770
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
758771
version "6.0.1"
759772
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
@@ -823,10 +836,10 @@ tunnel-agent@^0.6.0:
823836
dependencies:
824837
safe-buffer "^5.0.1"
825838

826-
typescript@^5.1.6:
827-
version "5.1.6"
828-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"
829-
integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==
839+
typescript@^5.5.3:
840+
version "5.5.3"
841+
resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz"
842+
integrity sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==
830843

831844
universalify@^2.0.0:
832845
version "2.0.0"

0 commit comments

Comments
 (0)