mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-24 06:14:01 +08:00
rl[Symbol.dispose]() closes the interface, as Node's dispose method calls close(). rl instanceof readline.Interface and readlinePromises.Interface answer which module created the interface: rl.create's mode marks readline/promises interfaces, and the fallback declarations declare both Interface classes as values. In JavaScript, createInterface's input and output can be checked-dynamic values (a function's result, an object's member, an element that may be undefined): rl.inputFromDyn and rl.outputFromDyn unbox the stream they hold, an output of null or undefined means no output, and other values are refused. In JavaScript, question() and setPrompt() accept a value that is not a string. When such a prompt is written, an interface that is not a terminal throws ERR_INVALID_ARG_TYPE as Node's kWriteToOutput does, and the readline/promises question rejects with it; the question stays pending and the previous prompt returns when it is answered. A terminal interface writes String(value) of a primitive. Corpus 5876-5878 match Node v24.22.0.