Files
scriptc/tests/corpus/stdio-write-errors.mjs
Chris Tate 3f66c8e20b Make LLVM the sole production backend
- Remove C emission, debugging options, and automatic backend fallback.
- Complete LLVM lowering and native bootstrap coverage across supported targets.
- Link executables and libraries with precompiled C runtime packs, including iOS and Android.
2026-09-29 20:54:09 -05:00

20 lines
555 B
JavaScript

import { closeSync } from 'node:fs';
const output = process.stdout;
const error = process.stderr;
function announce() {
output.write('ready\n');
error.write('starting\n');
}
announce();
function removed() { error.write('removed\n'); }
output.on('error', removed);
output.off('error', removed);
output.once('error', function(err) {
error.write(`event ${this === output} ${err.code}\n`);
});
closeSync(1);
const result = output.write('lost', err => {
error.write(`callback ${err ? err.message : 'none'}\n`);
});
error.write(`returned ${result}\n`);