mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-31 07:23:06 +08:00
process.emitWarning checks its arguments in Node's order: an options object replaces type with `options.type || "Warning"` and code with `options.code`, type and code are checked before the warning and for Error warnings too, an empty type names the warning "Warning", and a DeprecationWarning type returns at once under process.noDeprecation. Wrong kinds throw ERR_INVALID_ARG_TYPE with Node's "Received ..." tail. An instance of an Error subclass is an Error warning, and a typed record in the options position is read as the options object. The default report reads the warning's message, code and detail as property reads do, so an Error subclass's own code is reported. A deprecation thrown under process.throwDeprecation is thrown as the Error it encodes, so the uncaught report names it. process.kill throws ERR_UNKNOWN_SIGNAL for an unknown signal name, as subprocess.kill does, and a failed kill(2) is Node's errnoException with errno, code and syscall. A failed process.chdir names the working directory as path and the target as dest. os.userInfo() reads the passwd entry of the effective uid: uid and gid are the entry's pw_uid and pw_gid (-1 on Windows), not the process ids. os.homedir() answers $HOME whenever it is set, an empty value included. The minimal test/common for Node's test/parallel files gains isAIX, isIBMi and isSunOS.
Node test/parallel files
run.mjs builds files from a Node.js checkout's test/parallel with scriptc, runs each executable in that directory, and compares its exit status with Node's. It records a verdict per file: pass (the same exit code, or the same terminating signal), fail (a different exit code or signal), or refused (the build failed), with the first error line.
git clone --depth 1 --branch v24.22.0 https://github.com/nodejs/node /path/to/node
node tests/node-parallel/run.mjs --node /path/to/node --pattern '^test-(url-|whatwg-url-|querystring)'
Options:
--node: a Node.js checkout, or itstestdirectory. Use the version in.node-version.--pattern: a regular expression over file names intest/parallel.--common:minimal(the default) ornode.minimalcopies the selected files into<out>/tree/test/paralleland usescommon/index.cjsandcommon/wpt.cjsfrom this directory astest/common/index.jsandtest/common/wpt.js, with the checkout'stest/fixturesandtest/common/fixtures.js. The minimal common has the helpers these files use (mustCall,mustNotCall,skip,expectWarning,invalidArgTypeHelper,spawnPromisified,hasIntl,isWindows, ...) with Node's semantics, so a verdict measures the module under test rather than Node's fulltest/common.nodebuilds the files in place against Node's owntest/common.
--out: where executables and results go (defaultnode_modules/.cache/scriptc-node-parallel).--cli: the scriptc CLI entry (defaultpackages/cli/dist/main.js).--jobs: concurrent files (default 4).
Node runs each file with its // Flags: line. Results are written to <out>/results.json and <out>/results.md.
Before a lane relies on the minimal common, run its files under Node in <out>/tree/test/parallel: they should all pass there.