Skip to content

typings: wire up spawn_sync internal binding types - #65996

Open
agape1225 wants to merge 2 commits into
nodejs:mainfrom
agape1225:typings-wire-up-spawn-sync-binding
Open

agape1225 wants to merge 2 commits into
nodejs:mainfrom
agape1225:typings-wire-up-spawn-sync-binding

Conversation

@agape1225

Copy link
Copy Markdown
Contributor

Add typings for the spawn_sync internal binding.

Signed-off-by: agape1225 <49804691+agape1225@users.noreply.github.com>
@nodejs-github-bot nodejs-github-bot added the typings Issues and PRs related to internal TypeScript declarations. label Sep 12, 2026

@daeyeon daeyeon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some types don't seem to fully match the implementation. For example, uid also accepts null, and stdio[].input accepts any ArrayBufferView.

Address review feedback from daeyeon: several fields accept more than
what was typed.

- src/spawn_sync.cc checks uid, gid, timeout, maxBuffer, and killSignal
  with IsNullOrUndefined(), same as cwd/envPairs, so null is a valid
  "unset" value for all of them, not just undefined.
- stdio[].input is passed to Buffer::HasInstance(), whose actual
  definition (src/node_buffer.cc) is just val->IsArrayBufferView() -
  any ArrayBufferView is accepted, not only Uint8Array.

Signed-off-by: agape1225 <49804691+agape1225@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

typings Issues and PRs related to internal TypeScript declarations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants