mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
`x.constructor` on a value typed as EventEmitter or a stream class stopped at SC2020. The runtime now records each instance's Node class name: fs streams as ReadStream and WriteStream, child process stdio as Socket, worker stdio as ReadableWorkerStdio and WritableWorkerStdio, and Hash/Hmac stream views as Hash and Hmac (zlib streams, the base classes and program subclasses already did). The name is the one Node's leak warning and argument-type errors print, so those messages now name the same class as Node. `x.constructor.name` reads that name (scr_emitter_class_name). `x.constructor === C` for EventEmitter or a stream class tests the instance's own class: C's interval, none of its direct subclasses', and C's name, as fs, zlib, crypto, child process and worker streams share the base classes' vtables. `x.constructor` as a value is the class object of EventEmitter or the stream class the instance belongs to; for instances of the other runtime classes and of program subclasses it reports SC1090 at run time.