mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
* Expand static three.js workflows and host integration * Preserve JavaScript class state in static three.js workflows * Preserve inferred JavaScript behavior across static workflows * Preserve inferred callables and native compatibility boundaries * Retain annotated JavaScript factory exports and bootstrap-safe call spreads * Preserve Buffer and child callback identities in static packages * Clarify JavaScript symbol spread support
10 lines
490 B
JavaScript
10 lines
490 B
JavaScript
function recover(error) { return error.message; }
|
|
const error = new Error('failed');
|
|
console.log(await Promise.reject(error).catch(recover));
|
|
function accept(value) { return value; }
|
|
console.log(await Promise.resolve(7).catch(recover));
|
|
console.log(await Promise.resolve().then(() => {}).catch(recover));
|
|
try { await Promise.reject(error).catch(undefined); }
|
|
catch (caught) { console.log(caught === error); }
|
|
console.log(await Promise.reject(2).catch(value => Promise.resolve(value + 3)));
|