From 1faac2dce380afa387f08780ae1a79d087b3acf0 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 31 Jul 2024 16:28:08 +0200 Subject: fix(ext/node): handle node child_process with --v8-options flag (#24804) Makes `v8flags` package from NPM work. --- tests/specs/run/npm_v8flags/__test__.jsonc | 5 +++++ tests/specs/run/npm_v8flags/main.js | 17 +++++++++++++++++ tests/specs/run/npm_v8flags/main.out | 3 +++ 3 files changed, 25 insertions(+) create mode 100644 tests/specs/run/npm_v8flags/__test__.jsonc create mode 100644 tests/specs/run/npm_v8flags/main.js create mode 100644 tests/specs/run/npm_v8flags/main.out (limited to 'tests/specs') diff --git a/tests/specs/run/npm_v8flags/__test__.jsonc b/tests/specs/run/npm_v8flags/__test__.jsonc new file mode 100644 index 000000000..88d13e769 --- /dev/null +++ b/tests/specs/run/npm_v8flags/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run -A main.js", + "output": "main.out", + "exitCode": 0 +} diff --git a/tests/specs/run/npm_v8flags/main.js b/tests/specs/run/npm_v8flags/main.js new file mode 100644 index 000000000..5c870d221 --- /dev/null +++ b/tests/specs/run/npm_v8flags/main.js @@ -0,0 +1,17 @@ +import v8flags from "npm:v8flags@4.0.1"; + +const flags = await new Promise((resolve, reject) => { + v8flags((err, flags) => { + if (err) { + reject(err); + } else { + resolve(flags); + } + }); +}); + +if (flags.length < 100) { + throw new Error("Expected at least 100 flags"); +} + +console.log("ok"); diff --git a/tests/specs/run/npm_v8flags/main.out b/tests/specs/run/npm_v8flags/main.out new file mode 100644 index 000000000..56c61f0ea --- /dev/null +++ b/tests/specs/run/npm_v8flags/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/v8flags +Download http://localhost:4260/v8flags/v8flags-4.0.1.tgz +ok -- cgit v1.2.3