Repository navigation
feat(child_process,util): ChildProcess/Stream exports (#1856) + promisify(exec/execFile) (#1857) - #1861
Merged
Conversation
…sify(exec/execFile) (#1857) Closes the two follow-ups from the streaming-spawn work (#1780/#1858); together they make the test_parity_child_process gap test byte-identical to `node --experimental-strip-types`. #1856 — `child_process.ChildProcess` now reads as `[Function: ChildProcess]` and `child_process.Stream` as `undefined` (Node does not export it), instead of the value-read tripping the #463 unimplemented-surface gate at compile time (which previously blocked the whole gap test from compiling). Both are registered in the API manifest (docs regenerated); ChildProcess joins the runtime callable-export list; and the console function formatter now falls back to the closure's `name` property when no name is registered for the (shared bound-method) function pointer — so bound native exports print their real name (also nudges events.EventEmitter / tty.ReadStream toward Node parity). No parity fixture asserted the old `[Function (anonymous)]`. #1857 — `util.promisify(child_process.exec)` / `promisify(execFile)` now resolve to `{ stdout, stderr }` (Node's custom-promisify shape). main's general util.promisify resolves only the single first-result value, so this hooks a child_process-specific case into `util_promisify::js_util_promisify`: when the argument is the bound exec/execFile export it returns a wrapper that runs the command (Perry's synchronous model) and yields an already-resolved Promise of `{ stdout, stderr }`. exec/execFile also join the callable-export list so `child_process.exec` reads as a function. The full test_parity_child_process gap test is removed from known_failures. New regression test: test-files/test_issue_1856_1857_exports_promisify.ts.
This was referenced May 27, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the two follow-ups left from the streaming-
spawnwork (#1780 / #1858), which together make thetest_parity_child_processgap test byte-identical tonode --experimental-strip-types.#1856 —
child_process.ChildProcess/Streamnamed exportsA value-form read of
child_process.ChildProcess(e.g.console.log(child_process.ChildProcess)) tripped the#463unimplemented-surface gate at compile time, which blocked the whole gap test from compiling. Now:ChildProcessis registered in the API manifest (as a class) and added to the runtime callable-export list, so it reads as[Function: ChildProcess].Streamis registered as a manifest property and resolves toundefined(Node does not export it).nameproperty when no name is registered for the (shared bound-method) function pointer — so bound native exports print their real name. This also nudgesevents.EventEmitter/tty.ReadStreamtoward Node's output; no parity fixture asserted the old[Function (anonymous)].#1857 —
util.promisify(exec)/promisify(execFile)main's general
util.promisify(shipped separately) resolves to the single first-result value — but Node attaches a custom promisify hook toexec/execFilethat resolves to{ stdout, stderr }. Added a detection at the top ofutil_promisify::js_util_promisify: when the argument is the boundchild_process.exec/execFileexport, it returns a child_process-specific wrapper that runs the command (Perry's synchronous model) and yields an already-resolved Promise of{ stdout, stderr }.exec/execFilealso join the callable-export list sochild_process.execreads as a function (typeof === "function").Test
test_parity_child_process(the canonical gap test) is now byte-identical to Node — removed fromtest-parity/known_failures.json.test-files/test_issue_1856_1857_exports_promisify.ts(exports + promisify(exec/execFile)) is byte-identical.cargo fmt --all --checkclean; API docs regenerated.Built on top of the merged #1858; integrates with main's general
util.promisifyrather than duplicating it.