thrownewError('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)');
}
// `/` should be present at the end if `scriptDirectory` is not empty
varscriptDirectory='';
functionlocateFile(path){
if(Module['locateFile']){
returnModule['locateFile'](path,scriptDirectory);
}
returnscriptDirectory+path;
}
// Hooks that are implemented differently in different runtime environments.
varread_,
readAsync,
readBinary,
setWindowTitle;
// Normally we don't log exceptions but instead let them bubble out the top
// level where the embedding environment (e.g. the browser) can handle
// them.
// However under v8 and node we sometimes exit the process direcly in which case
// its up to use us to log the exception before exiting.
// If we fix https://github.com/emscripten-core/emscripten/issues/15080
// this may no longer be needed under node.
functionlogExceptionOnExit(e){
if(einstanceofExitStatus)return;
lettoLog=e;
if(e&&typeofe==='object'&&e.stack){
toLog=[e,e.stack];
}
err('exiting due to exception: '+toLog);
}
varfs;
varnodePath;
varrequireNodeFS;
if(ENVIRONMENT_IS_NODE){
if(!(typeofprocess==='object'&&typeofrequire==='function'))thrownewError('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
if((typeofprocess==='object'&&typeofrequire==='function')||typeofwindow==='object'||typeofimportScripts==='function')thrownewError('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
if(typeofread!='undefined'){
read_=functionshell_read(f){
returnread(f);
};
}
readBinary=functionreadBinary(f){
letdata;
if(typeofreadbuffer==='function'){
returnnewUint8Array(readbuffer(f));
}
data=read(f,'binary');
assert(typeofdata==='object');
returndata;
};
readAsync=functionreadAsync(f,onload,onerror){
setTimeout(()=>onload(readBinary(f)),0);
};
if(typeofscriptArgs!='undefined'){
arguments_=scriptArgs;
}elseif(typeofarguments!='undefined'){
arguments_=arguments;
}
if(typeofquit==='function'){
quit_=(status,toThrow)=>{
logExceptionOnExit(toThrow);
quit(status);
};
}
if(typeofprint!=='undefined'){
// Prefer to use print/printErr where they exist, as they usually work better.
if(!(typeofwindow==='object'||typeofimportScripts==='function'))thrownewError('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
// Differentiate the Web Worker from the Node Worker case, as reading must
abort('Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')
abort('Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')
abort('Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')
}
});
}
// perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message
// Assertions on removed incoming Module JS APIs.
assert(typeofModule['memoryInitializerPrefixURL']==='undefined','Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead');
assert(typeofModule['pthreadMainPrefixURL']==='undefined','Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead');
assert(typeofModule['cdInitializerPrefixURL']==='undefined','Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead');
assert(typeofModule['filePackagePrefixURL']==='undefined','Module.filePackagePrefixURL option was removed, use Module.locateFile instead');
assert(typeofModule['read']==='undefined','Module.read option was removed (modify read_ in JS)');
assert(typeofModule['readAsync']==='undefined','Module.readAsync option was removed (modify readAsync in JS)');
assert(typeofModule['readBinary']==='undefined','Module.readBinary option was removed (modify readBinary in JS)');
assert(typeofModule['setWindowTitle']==='undefined','Module.setWindowTitle option was removed (modify setWindowTitle in JS)');
assert(typeofModule['TOTAL_MEMORY']==='undefined','Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY');
abort('Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')
abort('Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')
abort('Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')
abort('Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')
}
});
}
varIDBFS='IDBFS is no longer included by default; build with -lidbfs.js';
varPROXYFS='PROXYFS is no longer included by default; build with -lproxyfs.js';
varWORKERFS='WORKERFS is no longer included by default; build with -lworkerfs.js';
varNODEFS='NODEFS is no longer included by default; build with -lnodefs.js';
assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");
varSTACK_ALIGN=16;
varPOINTER_SIZE=4;
functiongetNativeTypeSize(type){
switch(type){
case'i1':case'i8':return1;
case'i16':return2;
case'i32':return4;
case'i64':return8;
case'float':return4;
case'double':return8;
default:{
if(type[type.length-1]==='*'){
returnPOINTER_SIZE;
}elseif(type[0]==='i'){
constbits=Number(type.substr(1));
assert(bits%8===0,'getNativeTypeSize invalid bits '+bits+', type '+type);
returnbits/8;
}else{
return0;
}
}
}
}
functionwarnOnce(text){
if(!warnOnce.shown)warnOnce.shown={};
if(!warnOnce.shown[text]){
warnOnce.shown[text]=1;
err(text);
}
}
// include: runtime_functions.js
// Wraps a JS function as a wasm function with a given signature.
functionconvertJsFunctionToWasm(func,sig){
// If the type reflection proposal is available, use the new
// "WebAssembly.Function" constructor.
// Otherwise, construct a minimal wasm module importing the JS function and
// re-exporting it.
if(typeofWebAssembly.Function==="function"){
vartypeNames={
'i':'i32',
'j':'i64',
'f':'f32',
'd':'f64'
};
vartype={
parameters:[],
results:sig[0]=='v'?[]:[typeNames[sig[0]]]
};
for(vari=1;i<sig.length;++i){
type.parameters.push(typeNames[sig[i]]);
}
returnnewWebAssembly.Function(type,func);
}
// The module is static, with the exception of the type section, which is
// generated based on the signature passed in.
vartypeSection=[
0x01,// id: section,
0x00,// length: 0 (placeholder)
0x01,// count: 1
0x60,// form: func
];
varsigRet=sig.slice(0,1);
varsigParam=sig.slice(1);
vartypeCodes={
'i':0x7f,// i32
'j':0x7e,// i64
'f':0x7d,// f32
'd':0x7c,// f64
};
// Parameters, length + signatures
typeSection.push(sigParam.length);
for(vari=0;i<sigParam.length;++i){
typeSection.push(typeCodes[sigParam[i]]);
}
// Return values, length + signatures
// With no multi-return in MVP, either 0 (void) or 1 (anything else)
abort('Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')
abort('Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')
}
});
}
if(typeofWebAssembly!=='object'){
abort('no native wasm support detected');
}
// include: runtime_safe_heap.js
// In MINIMAL_RUNTIME, setValue() and getValue() are only available when building with safe heap enabled, for heap safety checking.
// In traditional runtime, setValue() and getValue() are always available (although their use is highly discouraged due to perf penalties)
if((u0&0xF8)!=0xF0)warnOnce('Invalid UTF-8 leading byte 0x'+u0.toString(16)+' encountered when deserializing a UTF-8 string in wasm memory to a JS string!');
if(!(maxBytesToWrite>0))// Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.
return0;
varstartIdx=outIdx;
varendIdx=outIdx+maxBytesToWrite-1;// -1 for string null terminator.
for(vari=0;i<str.length;++i){
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
// See http://unicode.org/faq/utf_bom.html#utf16-3
// For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629
varu=str.charCodeAt(i);// possibly a lead surrogate
if(u>=0xD800&&u<=0xDFFF){
varu1=str.charCodeAt(++i);
u=0x10000+((u&0x3FF)<<10)|(u1&0x3FF);
}
if(u<=0x7F){
if(outIdx>=endIdx)break;
heap[outIdx++]=u;
}elseif(u<=0x7FF){
if(outIdx+1>=endIdx)break;
heap[outIdx++]=0xC0|(u>>6);
heap[outIdx++]=0x80|(u&63);
}elseif(u<=0xFFFF){
if(outIdx+2>=endIdx)break;
heap[outIdx++]=0xE0|(u>>12);
heap[outIdx++]=0x80|((u>>6)&63);
heap[outIdx++]=0x80|(u&63);
}else{
if(outIdx+3>=endIdx)break;
if(u>0x10FFFF)warnOnce('Invalid Unicode code point 0x'+u.toString(16)+' encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).');
heap[outIdx++]=0xF0|(u>>18);
heap[outIdx++]=0x80|((u>>12)&63);
heap[outIdx++]=0x80|((u>>6)&63);
heap[outIdx++]=0x80|(u&63);
}
}
// Null-terminate the pointer to the buffer.
heap[outIdx]=0;
returnoutIdx-startIdx;
}
// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
// null-terminated and encoded in UTF8 form. The copy will require at most str.length*4+1 bytes of space in the HEAP.
// Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write.
// Returns the number of bytes written, EXCLUDING the null terminator.
functionstringToUTF8(str,outPtr,maxBytesToWrite){
assert(typeofmaxBytesToWrite=='number','stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
// Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.
functionlengthBytesUTF8(str){
varlen=0;
for(vari=0;i<str.length;++i){
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
// See http://unicode.org/faq/utf_bom.html#utf16-3
varu=str.charCodeAt(i);// possibly a lead surrogate
assert(outPtr%2==0,'Pointer passed to stringToUTF16 must be aligned to two bytes!');
assert(typeofmaxBytesToWrite=='number','stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
// Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
// charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.
varcodeUnit=str.charCodeAt(i);// possibly a lead surrogate
HEAP16[((outPtr)>>1)]=codeUnit;
outPtr+=2;
}
// Null-terminate the pointer to the HEAP.
HEAP16[((outPtr)>>1)]=0;
returnoutPtr-startPtr;
}
// Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
functionlengthBytesUTF16(str){
returnstr.length*2;
}
functionUTF32ToString(ptr,maxBytesToRead){
assert(ptr%4==0,'Pointer passed to UTF32ToString must be aligned to four bytes!');
vari=0;
varstr='';
// If maxBytesToRead is not passed explicitly, it will be undefined, and this
// will always evaluate to true. This saves on code size.
while(!(i>=maxBytesToRead/4)){
varutf32=HEAP32[(((ptr)+(i*4))>>2)];
if(utf32==0)break;
++i;
// Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.
// See http://unicode.org/faq/utf_bom.html#utf16-3
assert(outPtr%4==0,'Pointer passed to stringToUTF32 must be aligned to four bytes!');
assert(typeofmaxBytesToWrite=='number','stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
// Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
if(maxBytesToWrite===undefined){
maxBytesToWrite=0x7FFFFFFF;
}
if(maxBytesToWrite<4)return0;
varstartPtr=outPtr;
varendPtr=startPtr+maxBytesToWrite-4;
for(vari=0;i<str.length;++i){
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
// See http://unicode.org/faq/utf_bom.html#utf16-3
varcodeUnit=str.charCodeAt(i);// possibly a lead surrogate
// Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
functionlengthBytesUTF32(str){
varlen=0;
for(vari=0;i<str.length;++i){
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
// See http://unicode.org/faq/utf_bom.html#utf16-3
varcodeUnit=str.charCodeAt(i);
if(codeUnit>=0xD800&&codeUnit<=0xDFFF)++i;// possibly a lead surrogate, so skip over the tail surrogate.
len+=4;
}
returnlen;
}
// Allocate heap space for a JS string, and write it there.
// It is the responsibility of the caller to free() that memory.
functionallocateUTF8(str){
varsize=lengthBytesUTF8(str)+1;
varret=_malloc(size);
if(ret)stringToUTF8Array(str,HEAP8,ret,size);
returnret;
}
// Allocate stack space for a JS string, and write it there.
functionallocateUTF8OnStack(str){
varsize=lengthBytesUTF8(str)+1;
varret=stackAlloc(size);
stringToUTF8Array(str,HEAP8,ret,size);
returnret;
}
// Deprecated: This function should not be called because it is unsafe and does not provide
// a maximum length limit of how many bytes it is allowed to write. Prefer calling the
// function stringToUTF8Array() instead, which takes in a maximum length that can be used
abort('Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')
}
});
}
assert(INITIAL_MEMORY>=TOTAL_STACK,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+INITIAL_MEMORY+'! (TOTAL_STACK='+TOTAL_STACK+')');
// check for full engine support (use string 'subarray' to avoid closure compiler confusion)
'JS engine does not provide full typed array support');
// If memory is defined in wasm, the user can't provide it.
assert(!Module['wasmMemory'],'Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally');
assert(INITIAL_MEMORY==16777216,'Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically');
// include: runtime_init_table.js
// In regular non-RELOCATABLE mode the table is exported
// from the wasm module and this will be assigned once
// the exports are available.
varwasmTable;
// end include: runtime_init_table.js
// include: runtime_stack_check.js
// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.
functionwriteStackCookie(){
varmax=_emscripten_stack_get_end();
assert((max&3)==0);
// The stack grows downwards
HEAP32[((max+4)>>2)]=0x2135467;
HEAP32[((max+8)>>2)]=0x89BACDFE;
// Also test the global address 0 for integrity.
HEAP32[0]=0x63736d65;/* 'emsc' */
}
functioncheckStackCookie(){
if(ABORT)return;
varmax=_emscripten_stack_get_end();
varcookie1=HEAPU32[((max+4)>>2)];
varcookie2=HEAPU32[((max+8)>>2)];
if(cookie1!=0x2135467||cookie2!=0x89BACDFE){
abort('Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+cookie2.toString(16)+' 0x'+cookie1.toString(16));
}
// Also test the global address 0 for integrity.
if(HEAP32[0]!==0x63736d65/* 'emsc' */)abort('Runtime error: The application has corrupted its heap memory area (address zero)!');
}
// end include: runtime_stack_check.js
// include: runtime_assertions.js
// Endianness check
(function(){
varh16=newInt16Array(1);
varh8=newInt8Array(h16.buffer);
h16[0]=0x6373;
if(h8[0]!==0x73||h8[1]!==0x63)throw'Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)';
})();
// end include: runtime_assertions.js
var__ATPRERUN__=[];// functions called before the runtime is initialized
var__ATINIT__=[];// functions called during startup
var__ATEXIT__=[];// functions called during shutdown
var__ATPOSTRUN__=[];// functions called after the main() is called
assert(wasmTable,"table not found in wasm exports");
addOnInit(Module['asm']['__wasm_call_ctors']);
removeRunDependency('wasm-instantiate');
}
// we can't run yet (except in a pthread, where we have a custom sync instantiator)
addRunDependency('wasm-instantiate');
// Prefer streaming instantiation if available.
// Async compilation can be confusing when an error on the page overwrites Module
// (for example, if the order of elements is wrong, and the one defining Module is
// later), so we save Module and check it later.
vartrueModule=Module;
functionreceiveInstantiationResult(result){
// 'result' is a ResultObject object which has both the module and instance.
// receiveInstance() will swap in the exports (to Module.asm) so they can be called
assert(Module===trueModule,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?');
trueModule=null;
// TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.
// When the regression is fixed, can restore the above USE_PTHREADS-enabled path.
receiveInstance(result['instance']);
}
functioninstantiateArrayBuffer(receiver){
returngetBinaryPromise().then(function(binary){
returnWebAssembly.instantiate(binary,info);
}).then(function(instance){
returninstance;
}).then(receiver,function(reason){
err('failed to asynchronously prepare wasm: '+reason);
// Warn on some common problems.
if(isFileURI(wasmBinaryFile)){
err('warning: Loading from a file URI ('+wasmBinaryFile+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing');
// Thrown object is prepended by exception metadata block
return_malloc(size+16)+16;
}
functionExceptionInfo(excPtr){
this.excPtr=excPtr;
this.ptr=excPtr-16;
this.set_type=function(type){
HEAP32[(((this.ptr)+(4))>>2)]=type;
};
this.get_type=function(){
returnHEAP32[(((this.ptr)+(4))>>2)];
};
this.set_destructor=function(destructor){
HEAP32[(((this.ptr)+(8))>>2)]=destructor;
};
this.get_destructor=function(){
returnHEAP32[(((this.ptr)+(8))>>2)];
};
this.set_refcount=function(refcount){
HEAP32[((this.ptr)>>2)]=refcount;
};
this.set_caught=function(caught){
caught=caught?1:0;
HEAP8[(((this.ptr)+(12))>>0)]=caught;
};
this.get_caught=function(){
returnHEAP8[(((this.ptr)+(12))>>0)]!=0;
};
this.set_rethrown=function(rethrown){
rethrown=rethrown?1:0;
HEAP8[(((this.ptr)+(13))>>0)]=rethrown;
};
this.get_rethrown=function(){
returnHEAP8[(((this.ptr)+(13))>>0)]!=0;
};
// Initialize native structure fields. Should be called once after allocated.
this.init=function(type,destructor){
this.set_type(type);
this.set_destructor(destructor);
this.set_refcount(0);
this.set_caught(false);
this.set_rethrown(false);
}
this.add_ref=function(){
varvalue=HEAP32[((this.ptr)>>2)];
HEAP32[((this.ptr)>>2)]=value+1;
};
// Returns true if last reference released.
this.release_ref=function(){
varprev=HEAP32[((this.ptr)>>2)];
HEAP32[((this.ptr)>>2)]=prev-1;
assert(prev>0);
returnprev===1;
};
}
varexceptionLast=0;
varuncaughtExceptionCount=0;
function___cxa_throw(ptr,type,destructor){
varinfo=newExceptionInfo(ptr);
// Initialize ExceptionInfo content after it was allocated in __cxa_allocate_exception.
info.init(type,destructor);
exceptionLast=ptr;
uncaughtExceptionCount++;
throwptr+" - Exception catching is disabled, this exception cannot be caught. Compile with -s NO_DISABLE_EXCEPTION_CATCHING or -s EXCEPTION_CATCHING_ALLOWED=[..] to catch.";
}
function_abort(){
abort('native code called abort()');
}
function_emscripten_memcpy_big(dest,src,num){
HEAPU8.copyWithin(dest,src,src+num);
}
functionabortOnCannotGrowMemory(requestedSize){
abort('Cannot enlarge memory arrays to size '+requestedSize+' bytes (OOM). Either (1) compile with -s INITIAL_MEMORY=X with X higher than the current value '+HEAP8.length+', (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ');
// we couldn't find a proper implementation, as Math.random() is not suitable for /dev/random, see emscripten-core/emscripten/pull/7096
returnfunction(){abort("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };");};
// // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?
// // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation
// // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?
// // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle
// // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call
}elseif(node.usedBytes===0&&position===0){// If this is a simple first write to an empty file, do a fast set since we don't need to care about old data.
node.contents=buffer.slice(offset,offset+length);
node.usedBytes=length;
returnlength;
}elseif(position+length<=node.usedBytes){// Writing to an already allocated and used subrange of the file?
assert(arrayBuffer,'Loading data file "'+url+'" failed (no arrayBuffer).');
onload(newUint8Array(arrayBuffer));
if(dep)removeRunDependency(dep);
},function(event){
if(onerror){
onerror();
}else{
throw'Loading data file "'+url+'" failed.';
}
});
if(dep)addRunDependency(dep);
}
varERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"};
// Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)
[44].forEach(function(code){
FS.genericErrors[code]=newFS.ErrnoError(code);
FS.genericErrors[code].stack='<generic error, no stack>';
});
},staticInit:function(){
FS.ensureErrnoError();
FS.nameTable=newArray(4096);
FS.mount(MEMFS,{},'/');
FS.createDefaultDirectories();
FS.createDefaultDevices();
FS.createSpecialDirectories();
FS.filesystems={
'MEMFS':MEMFS,
};
},init:function(input,output,error){
assert(!FS.init.initialized,'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');
FS.init.initialized=true;
FS.ensureErrnoError();
// Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here
Module['stdin']=input||Module['stdin'];
Module['stdout']=output||Module['stdout'];
Module['stderr']=error||Module['stderr'];
FS.createStandardStreams();
},quit:function(){
FS.init.initialized=false;
// force-flush all streams, so we get musl std streams printed out
_fflush(0);
// close all of our streams
for(vari=0;i<FS.streams.length;i++){
varstream=FS.streams[i];
if(!stream){
continue;
}
FS.close(stream);
}
},getMode:function(canRead,canWrite){
varmode=0;
if(canRead)mode|=292|73;
if(canWrite)mode|=146;
returnmode;
},findObject:function(path,dontResolveLastLink){
varret=FS.analyzePath(path,dontResolveLastLink);
if(ret.exists){
returnret.object;
}else{
returnnull;
}
},analyzePath:function(path,dontResolveLastLink){
// operate from within the context of the symlink's target
thrownewError("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
}elseif(read_){
// Command-line.
try{
// WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as
'%c':'%a %b %d %H:%M:%S %Y',// Replaced by the locale's appropriate date and time representation - e.g., Mon Aug 3 14:02:01 2013
'%D':'%m/%d/%y',// Equivalent to %m / %d / %y
'%F':'%Y-%m-%d',// Equivalent to %Y - %m - %d
'%h':'%b',// Equivalent to %b
'%r':'%I:%M:%S %p',// Replaced by the time in a.m. and p.m. notation
'%R':'%H:%M',// Replaced by the time in 24-hour notation
'%T':'%H:%M:%S',// Replaced by the time
'%x':'%m/%d/%y',// Replaced by the locale's appropriate date representation
'%X':'%H:%M:%S',// Replaced by the locale's appropriate time representation
// Modified Conversion Specifiers
'%Ec':'%c',// Replaced by the locale's alternative appropriate date and time representation.
'%EC':'%C',// Replaced by the name of the base year (period) in the locale's alternative representation.
'%Ex':'%m/%d/%y',// Replaced by the locale's alternative date representation.
'%EX':'%H:%M:%S',// Replaced by the locale's alternative time representation.
'%Ey':'%y',// Replaced by the offset from %EC (year only) in the locale's alternative representation.
'%EY':'%Y',// Replaced by the full alternative year representation.
'%Od':'%d',// Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading zeros if there is any alternative symbol for zero; otherwise, with leading <space> characters.
'%Oe':'%e',// Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading <space> characters.
'%OH':'%H',// Replaced by the hour (24-hour clock) using the locale's alternative numeric symbols.
'%OI':'%I',// Replaced by the hour (12-hour clock) using the locale's alternative numeric symbols.
'%Om':'%m',// Replaced by the month using the locale's alternative numeric symbols.
'%OM':'%M',// Replaced by the minutes using the locale's alternative numeric symbols.
'%OS':'%S',// Replaced by the seconds using the locale's alternative numeric symbols.
'%Ou':'%u',// Replaced by the weekday as a number in the locale's alternative representation (Monday=1).
'%OU':'%U',// Replaced by the week number of the year (Sunday as the first day of the week, rules corresponding to %U ) using the locale's alternative numeric symbols.
'%OV':'%V',// Replaced by the week number of the year (Monday as the first day of the week, rules corresponding to %V ) using the locale's alternative numeric symbols.
'%Ow':'%w',// Replaced by the number of the weekday (Sunday=0) using the locale's alternative numeric symbols.
'%OW':'%W',// Replaced by the week number of the year (Monday as the first day of the week) using the locale's alternative numeric symbols.
'%Oy':'%y',// Replaced by the year (offset from %C ) using the locale's alternative numeric symbols.
if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=()=>abort("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=()=>abort("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=()=>abort("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"cwrap"))Module["cwrap"]=()=>abort("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=()=>abort("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=()=>abort("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=()=>abort("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=()=>abort("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=()=>abort("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=()=>abort("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=()=>abort("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=()=>abort("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=()=>abort("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=()=>abort("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=()=>abort("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=()=>abort("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=()=>abort("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=()=>abort("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=()=>abort("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=()=>abort("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=()=>abort("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=()=>abort("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");
if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=()=>abort("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");
if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=()=>abort("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=()=>abort("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");
if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=()=>abort("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");
if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=()=>abort("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");
if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=()=>abort("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");
if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=()=>abort("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=()=>abort("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");
if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=()=>abort("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");
if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=()=>abort("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=()=>abort("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=()=>abort("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=()=>abort("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=()=>abort("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=()=>abort("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=()=>abort("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=()=>abort("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=()=>abort("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=()=>abort("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=()=>abort("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=()=>abort("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=()=>abort("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=()=>abort("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=()=>abort("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=()=>abort("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"keepRuntimeAlive"))Module["keepRuntimeAlive"]=()=>abort("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"zeroMemory"))Module["zeroMemory"]=()=>abort("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=()=>abort("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"setFileTime"))Module["setFileTime"]=()=>abort("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"abortOnCannotGrowMemory"))Module["abortOnCannotGrowMemory"]=()=>abort("'abortOnCannotGrowMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=()=>abort("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=()=>abort("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"withStackSave"))Module["withStackSave"]=()=>abort("'withStackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=()=>abort("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=()=>abort("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=()=>abort("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"inetPton4"))Module["inetPton4"]=()=>abort("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"inetNtop4"))Module["inetNtop4"]=()=>abort("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"inetPton6"))Module["inetPton6"]=()=>abort("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"inetNtop6"))Module["inetNtop6"]=()=>abort("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"readSockaddr"))Module["readSockaddr"]=()=>abort("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"writeSockaddr"))Module["writeSockaddr"]=()=>abort("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=()=>abort("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getHostByName"))Module["getHostByName"]=()=>abort("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=()=>abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=()=>abort("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=()=>abort("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getRandomDevice"))Module["getRandomDevice"]=()=>abort("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"traverseStack"))Module["traverseStack"]=()=>abort("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"convertFrameToPC"))Module["convertFrameToPC"]=()=>abort("'convertFrameToPC' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=()=>abort("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"saveInUnwindCache"))Module["saveInUnwindCache"]=()=>abort("'saveInUnwindCache' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"convertPCtoSourceLocation"))Module["convertPCtoSourceLocation"]=()=>abort("'convertPCtoSourceLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgsArray"))Module["readAsmConstArgsArray"]=()=>abort("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=()=>abort("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"mainThreadEM_ASM"))Module["mainThreadEM_ASM"]=()=>abort("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=()=>abort("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=()=>abort("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getExecutableName"))Module["getExecutableName"]=()=>abort("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"listenOnce"))Module["listenOnce"]=()=>abort("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"autoResumeAudioContext"))Module["autoResumeAudioContext"]=()=>abort("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"dynCallLegacy"))Module["dynCallLegacy"]=()=>abort("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getDynCaller"))Module["getDynCaller"]=()=>abort("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=()=>abort("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"callRuntimeCallbacks"))Module["callRuntimeCallbacks"]=()=>abort("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"wasmTableMirror"))Module["wasmTableMirror"]=()=>abort("'wasmTableMirror' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"setWasmTableEntry"))Module["setWasmTableEntry"]=()=>abort("'setWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getWasmTableEntry"))Module["getWasmTableEntry"]=()=>abort("'getWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"handleException"))Module["handleException"]=()=>abort("'handleException' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"runtimeKeepalivePush"))Module["runtimeKeepalivePush"]=()=>abort("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"runtimeKeepalivePop"))Module["runtimeKeepalivePop"]=()=>abort("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"callUserCallback"))Module["callUserCallback"]=()=>abort("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"maybeExit"))Module["maybeExit"]=()=>abort("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"safeSetTimeout"))Module["safeSetTimeout"]=()=>abort("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"asmjsMangle"))Module["asmjsMangle"]=()=>abort("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"asyncLoad"))Module["asyncLoad"]=()=>abort("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"alignMemory"))Module["alignMemory"]=()=>abort("'alignMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"mmapAlloc"))Module["mmapAlloc"]=()=>abort("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"reallyNegative"))Module["reallyNegative"]=()=>abort("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"unSign"))Module["unSign"]=()=>abort("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"reSign"))Module["reSign"]=()=>abort("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"formatString"))Module["formatString"]=()=>abort("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=()=>abort("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=()=>abort("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=()=>abort("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=()=>abort("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=()=>abort("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getSocketFromFD"))Module["getSocketFromFD"]=()=>abort("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getSocketAddress"))Module["getSocketAddress"]=()=>abort("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=()=>abort("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerKeyEventCallback"))Module["registerKeyEventCallback"]=()=>abort("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"specialHTMLTargets"))Module["specialHTMLTargets"]=()=>abort("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"maybeCStringToJsString"))Module["maybeCStringToJsString"]=()=>abort("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"findEventTarget"))Module["findEventTarget"]=()=>abort("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"findCanvasEventTarget"))Module["findCanvasEventTarget"]=()=>abort("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getBoundingClientRect"))Module["getBoundingClientRect"]=()=>abort("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"fillMouseEventData"))Module["fillMouseEventData"]=()=>abort("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerMouseEventCallback"))Module["registerMouseEventCallback"]=()=>abort("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerWheelEventCallback"))Module["registerWheelEventCallback"]=()=>abort("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerUiEventCallback"))Module["registerUiEventCallback"]=()=>abort("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerFocusEventCallback"))Module["registerFocusEventCallback"]=()=>abort("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"fillDeviceOrientationEventData"))Module["fillDeviceOrientationEventData"]=()=>abort("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerDeviceOrientationEventCallback"))Module["registerDeviceOrientationEventCallback"]=()=>abort("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"fillDeviceMotionEventData"))Module["fillDeviceMotionEventData"]=()=>abort("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerDeviceMotionEventCallback"))Module["registerDeviceMotionEventCallback"]=()=>abort("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"screenOrientation"))Module["screenOrientation"]=()=>abort("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"fillOrientationChangeEventData"))Module["fillOrientationChangeEventData"]=()=>abort("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerOrientationChangeEventCallback"))Module["registerOrientationChangeEventCallback"]=()=>abort("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"fillFullscreenChangeEventData"))Module["fillFullscreenChangeEventData"]=()=>abort("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerFullscreenChangeEventCallback"))Module["registerFullscreenChangeEventCallback"]=()=>abort("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerRestoreOldStyle"))Module["registerRestoreOldStyle"]=()=>abort("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"hideEverythingExceptGivenElement"))Module["hideEverythingExceptGivenElement"]=()=>abort("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"restoreHiddenElements"))Module["restoreHiddenElements"]=()=>abort("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"setLetterbox"))Module["setLetterbox"]=()=>abort("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"currentFullscreenStrategy"))Module["currentFullscreenStrategy"]=()=>abort("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"restoreOldWindowedStyle"))Module["restoreOldWindowedStyle"]=()=>abort("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"softFullscreenResizeWebGLRenderTarget"))Module["softFullscreenResizeWebGLRenderTarget"]=()=>abort("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"doRequestFullscreen"))Module["doRequestFullscreen"]=()=>abort("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"fillPointerlockChangeEventData"))Module["fillPointerlockChangeEventData"]=()=>abort("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerPointerlockChangeEventCallback"))Module["registerPointerlockChangeEventCallback"]=()=>abort("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerPointerlockErrorEventCallback"))Module["registerPointerlockErrorEventCallback"]=()=>abort("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"requestPointerLock"))Module["requestPointerLock"]=()=>abort("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"fillVisibilityChangeEventData"))Module["fillVisibilityChangeEventData"]=()=>abort("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerVisibilityChangeEventCallback"))Module["registerVisibilityChangeEventCallback"]=()=>abort("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerTouchEventCallback"))Module["registerTouchEventCallback"]=()=>abort("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"fillGamepadEventData"))Module["fillGamepadEventData"]=()=>abort("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerGamepadEventCallback"))Module["registerGamepadEventCallback"]=()=>abort("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerBeforeUnloadEventCallback"))Module["registerBeforeUnloadEventCallback"]=()=>abort("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"fillBatteryEventData"))Module["fillBatteryEventData"]=()=>abort("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"battery"))Module["battery"]=()=>abort("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"registerBatteryEventCallback"))Module["registerBatteryEventCallback"]=()=>abort("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"setCanvasElementSize"))Module["setCanvasElementSize"]=()=>abort("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getCanvasElementSize"))Module["getCanvasElementSize"]=()=>abort("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=()=>abort("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=()=>abort("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=()=>abort("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=()=>abort("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=()=>abort("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"checkWasiClock"))Module["checkWasiClock"]=()=>abort("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=()=>abort("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=()=>abort("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=()=>abort("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=()=>abort("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=()=>abort("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=()=>abort("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=()=>abort("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=()=>abort("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=()=>abort("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"setImmediateWrapped"))Module["setImmediateWrapped"]=()=>abort("'setImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"clearImmediateWrapped"))Module["clearImmediateWrapped"]=()=>abort("'clearImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"polyfillSetImmediate"))Module["polyfillSetImmediate"]=()=>abort("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"uncaughtExceptionCount"))Module["uncaughtExceptionCount"]=()=>abort("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"exceptionLast"))Module["exceptionLast"]=()=>abort("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"exceptionCaught"))Module["exceptionCaught"]=()=>abort("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"ExceptionInfo"))Module["ExceptionInfo"]=()=>abort("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"CatchInfo"))Module["CatchInfo"]=()=>abort("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"exception_addRef"))Module["exception_addRef"]=()=>abort("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"exception_decRef"))Module["exception_decRef"]=()=>abort("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=()=>abort("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"funcWrappers"))Module["funcWrappers"]=()=>abort("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=()=>abort("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"setMainLoop"))Module["setMainLoop"]=()=>abort("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"wget"))Module["wget"]=()=>abort("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"FS"))Module["FS"]=()=>abort("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"MEMFS"))Module["MEMFS"]=()=>abort("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"TTY"))Module["TTY"]=()=>abort("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"PIPEFS"))Module["PIPEFS"]=()=>abort("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"SOCKFS"))Module["SOCKFS"]=()=>abort("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"_setNetworkCallback"))Module["_setNetworkCallback"]=()=>abort("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"tempFixedLengthArray"))Module["tempFixedLengthArray"]=()=>abort("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"miniTempWebGLFloatBuffers"))Module["miniTempWebGLFloatBuffers"]=()=>abort("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"heapObjectForWebGLType"))Module["heapObjectForWebGLType"]=()=>abort("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"heapAccessShiftForWebGLHeap"))Module["heapAccessShiftForWebGLHeap"]=()=>abort("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=()=>abort("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=()=>abort("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"computeUnpackAlignedImageSize"))Module["computeUnpackAlignedImageSize"]=()=>abort("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=()=>abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=()=>abort("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"webglGetUniformLocation"))Module["webglGetUniformLocation"]=()=>abort("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"webglPrepareUniformLocationsBeforeFirstUse"))Module["webglPrepareUniformLocationsBeforeFirstUse"]=()=>abort("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"webglGetLeftBracePos"))Module["webglGetLeftBracePos"]=()=>abort("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=()=>abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"writeGLArray"))Module["writeGLArray"]=()=>abort("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=()=>abort("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=()=>abort("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=()=>abort("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=()=>abort("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=()=>abort("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=()=>abort("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=()=>abort("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=()=>abort("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=()=>abort("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=()=>abort("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=()=>abort("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=()=>abort("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=()=>abort("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=()=>abort("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=()=>abort("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=()=>abort("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=()=>abort("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=()=>abort("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=()=>abort("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=()=>abort("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=()=>abort("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=()=>abort("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=()=>abort("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=()=>abort("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=()=>abort("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=()=>abort("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=()=>abort("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
Module["writeStackCookie"]=writeStackCookie;
Module["checkStackCookie"]=checkStackCookie;
if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});
if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});
varcalledRun;
/**
*@constructor
*@this{ExitStatus}
*/
functionExitStatus(status){
this.name="ExitStatus";
this.message="Program terminated with exit("+status+")";
this.status=status;
}
varcalledMain=false;
dependenciesFulfilled=functionrunCaller(){
// If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
if(!calledRun)run();
if(!calledRun)dependenciesFulfilled=runCaller;// try this again later, after new deps are fulfilled
};
functionstackCheckInit(){
// This is normally called automatically during __wasm_call_ctors but need to
// get these values before even running any of the ctors so we call it redundantly
// here.
// TODO(sbc): Move writeStackCookie to native to to avoid this.
_emscripten_stack_init();
writeStackCookie();
}
/** @type {function(Array=)} */
functionrun(args){
args=args||arguments_;
if(runDependencies>0){
return;
}
stackCheckInit();
preRun();
// a preRun added a dependency, run will be called later
if(runDependencies>0){
return;
}
functiondoRun(){
// run may have just been called through dependencies being fulfilled just in this very frame,
// or while the async setStatus time below was happening
assert(!Module['_main'],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');
postRun();
}
if(Module['setStatus']){
Module['setStatus']('Running...');
setTimeout(function(){
setTimeout(function(){
Module['setStatus']('');
},1);
doRun();
},1);
}else
{
doRun();
}
checkStackCookie();
}
Module['run']=run;
functioncheckUnflushedContent(){
// Compiler settings do not allow exiting the runtime, so flushing
// the streams is not possible. but in ASSERTIONS mode we check
// if there was something to flush, and if so tell the user they
// should request that the runtime be exitable.
// Normally we would not even include flush() at all, but in ASSERTIONS
// builds we do so just for this check, and here we see if there is any
// content to flush, that is, we check if there would have been
// something a non-ASSERTIONS build would have not seen.
// How we flush the streams depends on whether we are in SYSCALLS_REQUIRE_FILESYSTEM=0
// mode (which has its own special function for this; otherwise, all
// the code is inside libc)
varoldOut=out;
varoldErr=err;
varhas=false;
out=err=(x)=>{
has=true;
}
try{// it doesn't matter if it fails
_fflush(0);
// also flush in the JS FS layer
['stdout','stderr'].forEach(function(name){
varinfo=FS.analyzePath('/dev/'+name);
if(!info)return;
varstream=info.object;
varrdev=stream.rdev;
vartty=TTY.ttys[rdev];
if(tty&&tty.output&&tty.output.length){
has=true;
}
});
}catch(e){}
out=oldOut;
err=oldErr;
if(has){
warnOnce('stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.');
}
}
/** @param {boolean|number=} implicit */
functionexit(status,implicit){
EXITSTATUS=status;
checkUnflushedContent();
if(keepRuntimeAlive()){
// if exit() was called, we may warn the user if the runtime isn't actually being shut down
if(!implicit){
varmsg='program exited (with status: '+status+'), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)';