mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-15 04:50:40 +08:00
- 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.
20 lines
555 B
JavaScript
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`);
|