arudradey's picture
download
raw
617 Bytes
Module['preRun'] = () => {
console.log('preRun');
// it is ok to call cwrap before the runtime is loaded. we don't need the code
// and everything to be ready, since cwrap just prepares to call code, it
// doesn't actually call it
var wrappedAdd = Module['cwrap']('add', 'number', ['number', 'number']);
// but to call the compiled code, we must wait for the runtime
Module['onRuntimeInitialized'] = async () => {
console.log('onRuntimeInitialized');
if (wrappedAdd(5, 6) != 11) throw '5 + 6 should be 11';
// report success
await fetch('/report_result?0');
window.close();
};
};

Xet Storage Details

Size:
617 Bytes
·
Xet hash:
e7a37647ab2805e611532578a22ced5d4283f2c61ae167fd549e1a957ccd222e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.