diff --git a/packages/project-editor/flow/runtime/cpp/lvgl-runtime/v8.3/CMakeLists.txt b/packages/project-editor/flow/runtime/cpp/lvgl-runtime/v8.3/CMakeLists.txt index 8386afbf..b7c65398 100644 --- a/packages/project-editor/flow/runtime/cpp/lvgl-runtime/v8.3/CMakeLists.txt +++ b/packages/project-editor/flow/runtime/cpp/lvgl-runtime/v8.3/CMakeLists.txt @@ -5,15 +5,16 @@ project(lvgl_runtime_v8.3) # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DEMANGLE_SUPPORT=1 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 -s NODEJS_CATCH_EXIT=0 -s NODEJS_CATCH_REJECTION=0 -s INITIAL_MEMORY=83886080 -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS=@${EXPORTED_FUNCTIONS_FILE_PATH} -s EXPORTED_RUNTIME_METHODS=allocateUTF8,AsciiToString,UTF8ToString --pre-js ${PROJECT_SOURCE_DIR}/../common/pre.js --post-js ${PROJECT_SOURCE_DIR}/../common/post.js") # release -#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 --no-entry") -#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DEMANGLE_SUPPORT=1 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 -s NODEJS_CATCH_EXIT=0 -s NODEJS_CATCH_REJECTION=0 -s INITIAL_MEMORY=83886080 -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS=_malloc,_free -s EXPORTED_RUNTIME_METHODS=allocateUTF8,AsciiToString,UTF8ToString --pre-js ${PROJECT_SOURCE_DIR}/../common/pre.js --post-js ${PROJECT_SOURCE_DIR}/../common/post.js") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 --no-entry") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DEMANGLE_SUPPORT=1 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 -s NODEJS_CATCH_EXIT=0 -s NODEJS_CATCH_REJECTION=0 -s INITIAL_MEMORY=83886080 -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS=_malloc,_free -s EXPORTED_RUNTIME_METHODS=allocateUTF8,AsciiToString,UTF8ToString --pre-js ${PROJECT_SOURCE_DIR}/../common/pre.js --post-js ${PROJECT_SOURCE_DIR}/../common/post.js") # debug: - set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-const-variable -Wno-nested-anon-types -Wno-dollar-in-identifier-extension -O2 --no-entry -g") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-const-variable -Wno-nested-anon-types -Wno-dollar-in-identifier-extension -O2 --no-entry -g") -# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DEMANGLE_SUPPORT=1 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 -s NODEJS_CATCH_EXIT=0 -s NODEJS_CATCH_REJECTION=0 -s INITIAL_MEMORY=83886080 -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS=${EXPORTED_FUNCTIONS} -s EXPORTED_RUNTIME_METHODS=allocateUTF8,AsciiToString,UTF8ToString --pre-js ${PROJECT_SOURCE_DIR}/../common/pre.js --post-js ${PROJECT_SOURCE_DIR}/../common/post.js") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DEMANGLE_SUPPORT=1 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 -s NODEJS_CATCH_EXIT=0 -s NODEJS_CATCH_REJECTION=0 -s INITIAL_MEMORY=83886080 -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS=_malloc,_free -s EXPORTED_RUNTIME_METHODS=allocateUTF8,AsciiToString,UTF8ToString --pre-js ${PROJECT_SOURCE_DIR}/../common/pre.js --post-js ${PROJECT_SOURCE_DIR}/../common/post.js") - add_definitions(-DEMCC_DEBUG) +# set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-const-variable -Wno-nested-anon-types -Wno-dollar-in-identifier-extension -O2 --no-entry -g") +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-const-variable -Wno-nested-anon-types -Wno-dollar-in-identifier-extension -O2 --no-entry -g") +## set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DEMANGLE_SUPPORT=1 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 -s NODEJS_CATCH_EXIT=0 -s NODEJS_CATCH_REJECTION=0 -s INITIAL_MEMORY=83886080 -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS=${EXPORTED_FUNCTIONS} -s EXPORTED_RUNTIME_METHODS=allocateUTF8,AsciiToString,UTF8ToString --pre-js ${PROJECT_SOURCE_DIR}/../common/pre.js --post-js ${PROJECT_SOURCE_DIR}/../common/post.js") +# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DEMANGLE_SUPPORT=1 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 -s NODEJS_CATCH_EXIT=0 -s NODEJS_CATCH_REJECTION=0 -s INITIAL_MEMORY=83886080 -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS=_malloc,_free -s EXPORTED_RUNTIME_METHODS=allocateUTF8,AsciiToString,UTF8ToString --pre-js ${PROJECT_SOURCE_DIR}/../common/pre.js --post-js ${PROJECT_SOURCE_DIR}/../common/post.js") +# add_definitions(-DEMCC_DEBUG) + include_directories(${PROJECT_SOURCE_DIR}) include_directories(${PROJECT_SOURCE_DIR}/../common) diff --git a/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js b/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js index fde9482a..06f89332 100644 --- a/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js +++ b/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js @@ -66,6 +66,10 @@ var ENVIRONMENT_IS_WORKER = typeof importScripts == 'function'; var ENVIRONMENT_IS_NODE = typeof process == 'object' && typeof process.versions == 'object' && typeof process.versions.node == 'string'; var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; +if (Module['ENVIRONMENT']) { + throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)'); +} + // `/` should be present at the end if `scriptDirectory` is not empty var scriptDirectory = ''; function locateFile(path) { @@ -81,6 +85,15 @@ var read_, readBinary; if (ENVIRONMENT_IS_NODE) { + if (typeof process == 'undefined' || !process.release || process.release.name !== 'node') throw new Error('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?)'); + + var nodeVersion = process.versions.node; + var numericVersion = nodeVersion.split('.').slice(0, 3); + numericVersion = (numericVersion[0] * 10000) + (numericVersion[1] * 100) + (numericVersion[2].split('-')[0] * 1); + var minVersion = 160000; + if (numericVersion < 160000) { + throw new Error('This emscripten-generated code requires node v16.0.0 (detected v' + nodeVersion + ')'); + } // `require()` is no-op in an ESM module, use `createRequire()` to construct // the require()` function. This is only necessary for multi-environment @@ -110,6 +123,7 @@ readBinary = (filename) => { if (!ret.buffer) { ret = new Uint8Array(ret); } + assert(ret.buffer); return ret; }; @@ -139,6 +153,75 @@ readAsync = (filename, onload, onerror, binary = true) => { Module['inspect'] = () => '[Emscripten Module object]'; +} else +if (ENVIRONMENT_IS_SHELL) { + + if ((typeof process == 'object' && typeof require === 'function') || typeof window == 'object' || typeof importScripts == 'function') throw new Error('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 (typeof read != 'undefined') { + read_ = read; + } + + readBinary = (f) => { + if (typeof readbuffer == 'function') { + return new Uint8Array(readbuffer(f)); + } + let data = read(f, 'binary'); + assert(typeof data == 'object'); + return data; + }; + + readAsync = (f, onload, onerror) => { + setTimeout(() => onload(readBinary(f))); + }; + + if (typeof clearTimeout == 'undefined') { + globalThis.clearTimeout = (id) => {}; + } + + if (typeof setTimeout == 'undefined') { + // spidermonkey lacks setTimeout but we use it above in readAsync. + globalThis.setTimeout = (f) => (typeof f == 'function') ? f() : abort(); + } + + if (typeof scriptArgs != 'undefined') { + arguments_ = scriptArgs; + } else if (typeof arguments != 'undefined') { + arguments_ = arguments; + } + + if (typeof quit == 'function') { + quit_ = (status, toThrow) => { + // Unlike node which has process.exitCode, d8 has no such mechanism. So we + // have no way to set the exit code and then let the program exit with + // that code when it naturally stops running (say, when all setTimeouts + // have completed). For that reason, we must call `quit` - the only way to + // set the exit code - but quit also halts immediately. To increase + // consistency with node (and the web) we schedule the actual quit call + // using a setTimeout to give the current stack and any exception handlers + // a chance to run. This enables features such as addOnPostRun (which + // expected to be able to run code after main returns). + setTimeout(() => { + if (!(toThrow instanceof ExitStatus)) { + let toLog = toThrow; + if (toThrow && typeof toThrow == 'object' && toThrow.stack) { + toLog = [toThrow, toThrow.stack]; + } + err(`exiting due to exception: ${toLog}`); + } + quit(status); + }); + throw toThrow; + }; + } + + if (typeof print != 'undefined') { + // Prefer to use print/printErr where they exist, as they usually work better. + if (typeof console == 'undefined') console = /** @type{!Console} */({}); + console.log = /** @type{!function(this:Console, ...*): undefined} */ (print); + console.warn = console.error = /** @type{!function(this:Console, ...*): undefined} */ (typeof printErr != 'undefined' ? printErr : print); + } + } else // Note that this includes Node.js workers when relevant (pthreads is enabled). @@ -162,6 +245,8 @@ if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { scriptDirectory = ''; } + if (!(typeof window == 'object' || typeof importScripts == 'function')) throw new Error('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 // be done differently. { @@ -202,6 +287,7 @@ read_ = (url) => { } } else { + throw new Error('environment detection error'); } var out = Module['print'] || console.log.bind(console); @@ -212,19 +298,47 @@ Object.assign(Module, moduleOverrides); // Free the object hierarchy contained in the overrides, this lets the GC // reclaim data used e.g. in memoryInitializerRequest, which is a large typed array. moduleOverrides = null; +checkIncomingModuleAPI(); // Emit code to handle expected values on the Module object. This applies Module.x // to the proper local x. This has two benefits: first, we only emit it if it is // expected to arrive, and second, by using a local everywhere else that can be // minified. -if (Module['arguments']) arguments_ = Module['arguments']; +if (Module['arguments']) arguments_ = Module['arguments'];legacyModuleProp('arguments', 'arguments_'); -if (Module['thisProgram']) thisProgram = Module['thisProgram']; +if (Module['thisProgram']) thisProgram = Module['thisProgram'];legacyModuleProp('thisProgram', 'thisProgram'); -if (Module['quit']) quit_ = Module['quit']; +if (Module['quit']) quit_ = Module['quit'];legacyModuleProp('quit', 'quit_'); // 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(typeof Module['memoryInitializerPrefixURL'] == 'undefined', 'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['pthreadMainPrefixURL'] == 'undefined', 'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['cdInitializerPrefixURL'] == 'undefined', 'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['filePackagePrefixURL'] == 'undefined', 'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['read'] == 'undefined', 'Module.read option was removed (modify read_ in JS)'); +assert(typeof Module['readAsync'] == 'undefined', 'Module.readAsync option was removed (modify readAsync in JS)'); +assert(typeof Module['readBinary'] == 'undefined', 'Module.readBinary option was removed (modify readBinary in JS)'); +assert(typeof Module['setWindowTitle'] == 'undefined', 'Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)'); +assert(typeof Module['TOTAL_MEMORY'] == 'undefined', 'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'); +legacyModuleProp('asm', 'wasmExports'); +legacyModuleProp('read', 'read_'); +legacyModuleProp('readAsync', 'readAsync'); +legacyModuleProp('readBinary', 'readBinary'); +legacyModuleProp('setWindowTitle', 'setWindowTitle'); +var IDBFS = 'IDBFS is no longer included by default; build with -lidbfs.js'; +var PROXYFS = 'PROXYFS is no longer included by default; build with -lproxyfs.js'; +var WORKERFS = 'WORKERFS is no longer included by default; build with -lworkerfs.js'; +var FETCHFS = 'FETCHFS is no longer included by default; build with -lfetchfs.js'; +var ICASEFS = 'ICASEFS is no longer included by default; build with -licasefs.js'; +var JSFILEFS = 'JSFILEFS is no longer included by default; build with -ljsfilefs.js'; +var OPFS = 'OPFS is no longer included by default; build with -lopfs.js'; + +var NODEFS = '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 `-sENVIRONMENT` to enable."); + // end include: shell.js // include: preamble.js @@ -239,7 +353,7 @@ if (Module['quit']) quit_ = Module['quit']; // is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html var wasmBinary; -if (Module['wasmBinary']) wasmBinary = Module['wasmBinary']; +if (Module['wasmBinary']) wasmBinary = Module['wasmBinary'];legacyModuleProp('wasmBinary', 'wasmBinary'); if (typeof WebAssembly != 'object') { abort('no native wasm support detected'); @@ -265,13 +379,13 @@ var EXITSTATUS; /** @type {function(*, string=)} */ function assert(condition, text) { if (!condition) { - // This build was created without ASSERTIONS defined. `assert()` should not - // ever be called in this configuration but in case there are callers in - // the wild leave this simple abort() implemenation here for now. - abort(text); + abort('Assertion failed' + (text ? ': ' + text : '')); } } +// We used to include malloc/free by default in the past. Show a helpful error in +// builds with assertions. + // Memory management var HEAP, @@ -304,9 +418,62 @@ function updateMemoryViews() { Module['HEAPF64'] = HEAPF64 = new Float64Array(b); } +assert(!Module['STACK_SIZE'], 'STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time') + +assert(typeof Int32Array != 'undefined' && typeof Float64Array !== 'undefined' && Int32Array.prototype.subarray != undefined && Int32Array.prototype.set != undefined, + 'JS engine does not provide full typed array support'); + +// If memory is defined in wasm, the user can't provide it, or set INITIAL_MEMORY +assert(!Module['wasmMemory'], 'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'); +assert(!Module['INITIAL_MEMORY'], 'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'); + // 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. +function writeStackCookie() { + var max = _emscripten_stack_get_end(); + assert((max & 3) == 0); + // If the stack ends at address zero we write our cookies 4 bytes into the + // stack. This prevents interference with SAFE_HEAP and ASAN which also + // monitor writes to address zero. + if (max == 0) { + max += 4; + } + // The stack grow downwards towards _emscripten_stack_get_end. + // We write cookies to the final two words in the stack and detect if they are + // ever overwritten. + HEAPU32[((max)>>2)] = 0x02135467; + HEAPU32[(((max)+(4))>>2)] = 0x89BACDFE; + // Also test the global address 0 for integrity. + HEAPU32[((0)>>2)] = 1668509029; +} + +function checkStackCookie() { + if (ABORT) return; + var max = _emscripten_stack_get_end(); + // See writeStackCookie(). + if (max == 0) { + max += 4; + } + var cookie1 = HEAPU32[((max)>>2)]; + var cookie2 = HEAPU32[(((max)+(4))>>2)]; + if (cookie1 != 0x02135467 || cookie2 != 0x89BACDFE) { + abort(`Stack overflow! Stack cookie has been overwritten at ${ptrToString(max)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ptrToString(cookie2)} ${ptrToString(cookie1)}`); + } + // Also test the global address 0 for integrity. + if (HEAPU32[((0)>>2)] != 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() { + var h16 = new Int16Array(1); + var h8 = new Int8Array(h16.buffer); + h16[0] = 0x6373; + if (h8[0] !== 0x73 || h8[1] !== 0x63) throw 'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'; +})(); + // end include: runtime_assertions.js var __ATPRERUN__ = []; // functions called before the runtime is initialized var __ATINIT__ = []; // functions called during startup @@ -326,8 +493,11 @@ function preRun() { } function initRuntime() { + assert(!runtimeInitialized); runtimeInitialized = true; + checkStackCookie(); + if (!Module["noFSInit"] && !FS.init.initialized) FS.init(); @@ -338,6 +508,7 @@ TTY.init(); } function postRun() { + checkStackCookie(); if (Module['postRun']) { if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']]; @@ -373,6 +544,10 @@ function addOnPostRun(cb) { // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc +assert(Math.imul, 'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); +assert(Math.fround, 'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); +assert(Math.clz32, 'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); +assert(Math.trunc, 'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); // end include: runtime_math.js // A counter of dependencies for calling run(). If we need to // do asynchronous work before running, increment this and @@ -384,9 +559,14 @@ function addOnPostRun(cb) { var runDependencies = 0; var runDependencyWatcher = null; var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled +var runDependencyTracking = {}; function getUniqueRunDependency(id) { - return id; + var orig = id; + while (1) { + if (!runDependencyTracking[id]) return id; + id = orig + Math.random(); + } } function addRunDependency(id) { @@ -396,6 +576,33 @@ function addRunDependency(id) { Module['monitorRunDependencies'](runDependencies); } + if (id) { + assert(!runDependencyTracking[id]); + runDependencyTracking[id] = 1; + if (runDependencyWatcher === null && typeof setInterval != 'undefined') { + // Check for missing dependencies every few seconds + runDependencyWatcher = setInterval(() => { + if (ABORT) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + return; + } + var shown = false; + for (var dep in runDependencyTracking) { + if (!shown) { + shown = true; + err('still waiting on run dependencies:'); + } + err(`dependency: ${dep}`); + } + if (shown) { + err('(end of list)'); + } + }, 10000); + } + } else { + err('warning: run dependency added without ID'); + } } function removeRunDependency(id) { @@ -405,6 +612,12 @@ function removeRunDependency(id) { Module['monitorRunDependencies'](runDependencies); } + if (id) { + assert(runDependencyTracking[id]); + delete runDependencyTracking[id]; + } else { + err('warning: run dependency removed without ID'); + } if (runDependencies == 0) { if (runDependencyWatcher !== null) { clearInterval(runDependencyWatcher); @@ -432,8 +645,6 @@ function abort(what) { ABORT = true; EXITSTATUS = 1; - what += '. Build with -sASSERTIONS for more info.'; - // Use a wasm runtime error, because a JS error might be seen as a foreign // exception, which means we'd run destructors on it. We need the error to // simply make the program stop. @@ -474,6 +685,15 @@ var isDataURI = (filename) => filename.startsWith(dataURIPrefix); */ var isFileURI = (filename) => filename.startsWith('file://'); // end include: URIUtils.js +function createExportWrapper(name) { + return function() { + assert(runtimeInitialized, `native function \`${name}\` called before runtime initialization`); + var f = wasmExports[name]; + assert(f, `exported native function \`${name}\` not found`); + return f.apply(null, arguments); + }; +} + // include: runtime_exceptions.js // end include: runtime_exceptions.js var wasmBinaryFile; @@ -530,6 +750,10 @@ function instantiateArrayBuffer(binaryFile, imports, receiver) { }).then(receiver, (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`); + } abort(reason); }); } @@ -589,6 +813,11 @@ function createWasm() { wasmMemory = wasmExports['memory']; + assert(wasmMemory, "memory not found in wasm exports"); + // This assertion doesn't hold when emscripten is run in --post-link + // mode. + // TODO(sbc): Read INITIAL_MEMORY out of the wasm file in post-link mode. + //assert(wasmMemory.buffer.byteLength === 83886080); updateMemoryViews(); addOnInit(wasmExports['__wasm_call_ctors']); @@ -600,9 +829,15 @@ function createWasm() { 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. + var trueModule = Module; function receiveInstantiationResult(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 PTHREADS-enabled path. receiveInstance(result['instance']); @@ -633,29 +868,126 @@ var tempDouble; var tempI64; // include: runtime_debug.js +function legacyModuleProp(prop, newName, incomming=true) { + if (!Object.getOwnPropertyDescriptor(Module, prop)) { + Object.defineProperty(Module, prop, { + configurable: true, + get() { + let extra = incomming ? ' (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.${prop}\` has been replaced by \`${newName}\`` + extra); + + } + }); + } +} + +function ignoredModuleProp(prop) { + if (Object.getOwnPropertyDescriptor(Module, prop)) { + abort(`\`Module.${prop}\` was supplied but \`${prop}\` not included in INCOMING_MODULE_JS_API`); + } +} + +// forcing the filesystem exports a few things by default +function isExportedByForceFilesystem(name) { + return name === 'FS_createPath' || + name === 'FS_createDataFile' || + name === 'FS_createPreloadedFile' || + name === 'FS_unlink' || + name === 'addRunDependency' || + // The old FS has some functionality that WasmFS lacks. + name === 'FS_createLazyFile' || + name === 'FS_createDevice' || + name === 'removeRunDependency'; +} + +function missingGlobal(sym, msg) { + if (typeof globalThis !== 'undefined') { + Object.defineProperty(globalThis, sym, { + configurable: true, + get() { + warnOnce('`' + sym + '` is not longer defined by emscripten. ' + msg); + return undefined; + } + }); + } +} + +missingGlobal('buffer', 'Please use HEAP8.buffer or wasmMemory.buffer'); +missingGlobal('asm', 'Please use wasmExports instead'); + +function missingLibrarySymbol(sym) { + if (typeof globalThis !== 'undefined' && !Object.getOwnPropertyDescriptor(globalThis, sym)) { + Object.defineProperty(globalThis, sym, { + configurable: true, + get() { + // Can't `abort()` here because it would break code that does runtime + // checks. e.g. `if (typeof SDL === 'undefined')`. + var msg = '`' + sym + '` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line'; + // DEFAULT_LIBRARY_FUNCS_TO_INCLUDE requires the name as it appears in + // library.js, which means $name for a JS name with no prefix, or name + // for a JS name like _name. + var librarySymbol = sym; + if (!librarySymbol.startsWith('_')) { + librarySymbol = '$' + sym; + } + msg += " (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='" + librarySymbol + "')"; + if (isExportedByForceFilesystem(sym)) { + msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'; + } + warnOnce(msg); + return undefined; + } + }); + } + // Any symbol that is not included from the JS libary is also (by definition) + // not exported on the Module object. + unexportedRuntimeSymbol(sym); +} + +function unexportedRuntimeSymbol(sym) { + if (!Object.getOwnPropertyDescriptor(Module, sym)) { + Object.defineProperty(Module, sym, { + configurable: true, + get() { + var msg = "'" + sym + "' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)"; + if (isExportedByForceFilesystem(sym)) { + msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'; + } + abort(msg); + } + }); + } +} + +// Used by XXXXX_DEBUG settings to output debug messages. +function dbg(text) { + // TODO(sbc): Make this configurable somehow. Its not always convenient for + // logging to show up as warnings. + console.warn.apply(console, arguments); +} // end include: runtime_debug.js // === Body === var ASM_CONSTS = { - 971264: ($0) => { startToDebuggerMessage($0); }, - 971296: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); }, - 971371: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); }, - 971446: ($0) => { finishToDebuggerMessage($0); }, - 971479: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); }, - 971533: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); }, - 971587: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); }, - 971640: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); }, - 971693: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); }, - 971746: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); }, - 971779: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); }, - 971815: ($0, $1) => { lvglSetColorTheme($0, UTF8ToString($1)); }, - 971860: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); }, - 971966: ($0, $1) => { return eez_mqtt_deinit($0, $1); }, - 972002: ($0, $1) => { return eez_mqtt_connect($0, $1); }, - 972039: ($0, $1) => { return eez_mqtt_disconnect($0, $1); }, - 972079: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); }, - 972136: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); }, - 972195: ($0, $1, $2, $3) => { return eez_mqtt_publish($0, $1, UTF8ToString($2), UTF8ToString($3)); } + 1036736: ($0) => { startToDebuggerMessage($0); }, + 1036768: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); }, + 1036843: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); }, + 1036918: ($0) => { finishToDebuggerMessage($0); }, + 1036951: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); }, + 1037005: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); }, + 1037059: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); }, + 1037112: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); }, + 1037165: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); }, + 1037218: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); }, + 1037251: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); }, + 1037287: ($0, $1) => { lvglSetColorTheme($0, UTF8ToString($1)); }, + 1037332: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); }, + 1037438: ($0, $1) => { return eez_mqtt_deinit($0, $1); }, + 1037474: ($0, $1) => { return eez_mqtt_connect($0, $1); }, + 1037511: ($0, $1) => { return eez_mqtt_disconnect($0, $1); }, + 1037551: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); }, + 1037608: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); }, + 1037667: ($0, $1, $2, $3) => { return eez_mqtt_publish($0, $1, UTF8ToString($2), UTF8ToString($3)); } }; @@ -706,6 +1038,7 @@ var ASM_CONSTS = { }; var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => { + assert(typeof str === 'string'); // Parameter maxBytesToWrite is not optional. Negative values, 0, null, // undefined and false each don't write out any bytes. if (!(maxBytesToWrite > 0)) @@ -740,6 +1073,7 @@ var ASM_CONSTS = { heap[outIdx++] = 0x80 | (u & 63); } else { if (outIdx + 3 >= endIdx) break; + if (u > 0x10FFFF) warnOnce('Invalid Unicode code point ' + ptrToString(u) + ' 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); @@ -751,6 +1085,7 @@ var ASM_CONSTS = { return outIdx - startIdx; }; var stringToUTF8 = (str, outPtr, maxBytesToWrite) => { + assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); }; var stringToUTF8OnStack = (str) => { @@ -800,6 +1135,7 @@ var ASM_CONSTS = { if ((u0 & 0xF0) == 0xE0) { u0 = ((u0 & 15) << 12) | (u1 << 6) | u2; } else { + if ((u0 & 0xF8) != 0xF0) warnOnce('Invalid UTF-8 leading byte ' + ptrToString(u0) + ' encountered when deserializing a UTF-8 string in wasm memory to a JS string!'); u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63); } @@ -829,6 +1165,7 @@ var ASM_CONSTS = { * @return {string} */ var UTF8ToString = (ptr, maxBytesToRead) => { + assert(typeof ptr == 'number'); return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ''; }; var demangle = (func) => { @@ -880,6 +1217,13 @@ var ASM_CONSTS = { var noExitRuntime = Module['noExitRuntime'] || true; + var ptrToString = (ptr) => { + assert(typeof ptr === 'number'); + // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned. + ptr >>>= 0; + return '0x' + ptr.toString(16).padStart(8, '0'); + }; + /** * @param {number} ptr @@ -933,6 +1277,15 @@ var ASM_CONSTS = { return demangleAll(js); } + var warnOnce = (text) => { + if (!warnOnce.shown) warnOnce.shown = {}; + if (!warnOnce.shown[text]) { + warnOnce.shown[text] = 1; + if (ENVIRONMENT_IS_NODE) text = 'warning: ' + text; + err(text); + } + }; + var ___assert_fail = (condition, filename, line, func) => { abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']); }; @@ -1017,7 +1370,7 @@ var ASM_CONSTS = { info.init(type, destructor); exceptionLast = ptr; uncaughtExceptionCount++; - throw exceptionLast; + assert(false, 'Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.'); }; var setErrNo = (value) => { @@ -1125,7 +1478,7 @@ var ASM_CONSTS = { } } // we couldn't find a proper implementation, as Math.random() is not suitable for /dev/random, see emscripten-core/emscripten/pull/7096 - abort("initRandomDevice"); + 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: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };"); }; var randomFill = (view) => { // Lazily init on the first invocation. @@ -1404,10 +1757,11 @@ var ASM_CONSTS = { }; var alignMemory = (size, alignment) => { + assert(alignment, "alignment argument is required"); return Math.ceil(size / alignment) * alignment; }; var mmapAlloc = (size) => { - abort(); + abort('internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported'); }; var MEMFS = { ops_table:null, @@ -1635,6 +1989,7 @@ var ASM_CONSTS = { var contents = stream.node.contents; if (position >= stream.node.usedBytes) return 0; var size = Math.min(stream.node.usedBytes - position, length); + assert(size >= 0); if (size > 8 && contents.subarray) { // non-trivial, and typed array buffer.set(contents.subarray(position, position + size), offset); } else { @@ -1643,6 +1998,8 @@ var ASM_CONSTS = { return size; }, write(stream, buffer, offset, length, position, canOwn) { + // The data buffer should be a typed array view + assert(!(buffer instanceof ArrayBuffer)); // If the buffer is located in main memory (HEAP), and if // memory can grow, we can't hold on to references of the // memory buffer, as they may get invalidated. That means we @@ -1657,6 +2014,7 @@ var ASM_CONSTS = { if (buffer.subarray && (!node.contents || node.contents.subarray)) { // This write is from a typed array to a typed array? if (canOwn) { + assert(position === 0, 'canOwn must imply no weird position inside the file'); node.contents = buffer.subarray(offset, offset + length); node.usedBytes = length; return length; @@ -1832,6 +2190,132 @@ var ASM_CONSTS = { + + var ERRNO_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", + }; + + var ERRNO_CODES = { + }; + var FS = { root:null, mounts:[], @@ -1963,6 +2447,7 @@ var ASM_CONSTS = { return FS.lookup(parent, name); }, createNode(parent, name, mode, rdev) { + assert(typeof parent == 'object') var node = new FS.FSNode(parent, name, mode, rdev); FS.hashAddNode(node); @@ -2192,6 +2677,7 @@ var ASM_CONSTS = { var completed = 0; function doCallback(errCode) { + assert(FS.syncFSRequests > 0); FS.syncFSRequests--; return callback(errCode); } @@ -2218,6 +2704,11 @@ var ASM_CONSTS = { }); }, mount(type, opts, mountpoint) { + if (typeof type == 'string') { + // The filesystem was not included, and instead we have an error + // message stored in the variable. + throw type; + } var root = mountpoint === '/'; var pseudo = !mountpoint; var node; @@ -2296,6 +2787,7 @@ var ASM_CONSTS = { // remove this mount from the child mounts var idx = node.mount.mounts.indexOf(mount); + assert(idx !== -1); node.mount.mounts.splice(idx, 1); }, lookup(parent, name) { @@ -2739,6 +3231,7 @@ var ASM_CONSTS = { return stream.position; }, read(stream, buffer, offset, length, position) { + assert(offset >= 0); if (length < 0 || position < 0) { throw new FS.ErrnoError(28); } @@ -2765,6 +3258,7 @@ var ASM_CONSTS = { return bytesRead; }, write(stream, buffer, offset, length, position, canOwn) { + assert(offset >= 0); if (length < 0 || position < 0) { throw new FS.ErrnoError(28); } @@ -2833,6 +3327,7 @@ var ASM_CONSTS = { return stream.stream_ops.mmap(stream, length, position, prot, flags); }, msync(stream, buffer, offset, length, mmapFlags) { + assert(offset >= 0); if (!stream.stream_ops.msync) { return 0; } @@ -2986,6 +3481,9 @@ var ASM_CONSTS = { var stdin = FS.open('/dev/stdin', 0); var stdout = FS.open('/dev/stdout', 1); var stderr = FS.open('/dev/stderr', 1); + assert(stdin.fd === 0, `invalid handle for stdin (${stdin.fd})`); + assert(stdout.fd === 1, `invalid handle for stdout (${stdout.fd})`); + assert(stderr.fd === 2, `invalid handle for stderr (${stderr.fd})`); }, ensureErrnoError() { if (FS.ErrnoError) return; @@ -3000,10 +3498,23 @@ var ASM_CONSTS = { this.node = node; this.setErrno = /** @this{Object} */ function(errno) { this.errno = errno; + for (var key in ERRNO_CODES) { + if (ERRNO_CODES[key] === errno) { + this.code = key; + break; + } + } }; this.setErrno(errno); - this.message = 'FS error'; - + this.message = ERRNO_MESSAGES[errno]; + + // Try to get a maximally helpful stack trace. On Node.js, getting Error.stack + // now ensures it shows what we want. + if (this.stack) { + // Define the stack property for Node.js 4, which otherwise errors on the next line. + Object.defineProperty(this, "stack", { value: (new Error).stack, writable: true }); + this.stack = demangleAll(this.stack); + } }; FS.ErrnoError.prototype = new Error(); FS.ErrnoError.prototype.constructor = FS.ErrnoError; @@ -3029,6 +3540,7 @@ var ASM_CONSTS = { }; }, init(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(); @@ -3043,6 +3555,7 @@ var ASM_CONSTS = { quit() { FS.init.initialized = false; // force-flush all streams, so we get musl std streams printed out + _fflush(0); // close all of our streams for (var i = 0; i < FS.streams.length; i++) { var stream = FS.streams[i]; @@ -3341,6 +3854,7 @@ var ASM_CONSTS = { if (position >= contents.length) return 0; var size = Math.min(contents.length - position, length); + assert(size >= 0); if (contents.slice) { // normal array for (var i = 0; i < size; i++) { buffer[offset + i] = contents[position + i]; @@ -3370,6 +3884,24 @@ var ASM_CONSTS = { node.stream_ops = stream_ops; return node; }, + absolutePath() { + abort('FS.absolutePath has been removed; use PATH_FS.resolve instead'); + }, + createFolder() { + abort('FS.createFolder has been removed; use FS.mkdir instead'); + }, + createLink() { + abort('FS.createLink has been removed; use FS.symlink instead'); + }, + joinPath() { + abort('FS.joinPath has been removed; use PATH.join instead'); + }, + mmapAlloc() { + abort('FS.mmapAlloc has been replaced by the top level function mmapAlloc'); + }, + standardizePath() { + abort('FS.standardizePath has been removed; use PATH.normalize instead'); + }, }; var SYSCALLS = { @@ -3438,6 +3970,7 @@ var ASM_CONSTS = { }, varargs:undefined, get() { + assert(SYSCALLS.varargs != undefined); // the `+` prepended here is necessary to convince the JSCompiler that varargs is indeed a number. var ret = HEAP32[((+SYSCALLS.varargs)>>2)]; SYSCALLS.varargs += 4; @@ -3544,6 +4077,7 @@ var ASM_CONSTS = { FS.isLink(child.mode) ? 10 : // DT_LNK, symbolic link. 8; // DT_REG, regular file. } + assert(id); (tempI64 = [id>>>0,(tempDouble=id,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[((dirp + pos)>>2)] = tempI64[0],HEAP32[(((dirp + pos)+(4))>>2)] = tempI64[1]); (tempI64 = [(idx + 1) * struct_size>>>0,(tempDouble=(idx + 1) * struct_size,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((dirp + pos)+(8))>>2)] = tempI64[0],HEAP32[(((dirp + pos)+(12))>>2)] = tempI64[1]); HEAP16[(((dirp + pos)+(16))>>1)] = 280; @@ -3673,16 +4207,23 @@ var ASM_CONSTS = { var __emscripten_get_now_is_monotonic = () => nowIsMonotonic; var _abort = () => { - abort(''); + abort('native code called abort()'); }; var readEmAsmArgsArray = []; var readEmAsmArgs = (sigPtr, buf) => { + // Nobody should have mutated _readEmAsmArgsArray underneath us to be something else than an array. + assert(Array.isArray(readEmAsmArgsArray)); + // The input buffer is allocated on the stack, so it must be stack-aligned. + assert(buf % 16 == 0); readEmAsmArgsArray.length = 0; var ch; // Most arguments are i32s, so shift the buffer pointer so it is a plain // index into HEAP32. while (ch = HEAPU8[sigPtr++]) { + var chr = String.fromCharCode(ch); + var validChars = ['d', 'f', 'i', 'p']; + assert(validChars.includes(chr), `Invalid character ${ch}("${chr}") in readEmAsmArgs! Use only [${validChars}], and do not specify "v" for void return argument.`); // Floats are always passed as doubles, so all types except for 'i' // are 8 bytes and require alignment. var wide = (ch != 105); @@ -3701,6 +4242,7 @@ var ASM_CONSTS = { }; var runEmAsmFunction = (code, sigPtr, argbuf) => { var args = readEmAsmArgs(sigPtr, argbuf); + assert(ASM_CONSTS.hasOwnProperty(code), `No EM_ASM constant found at address ${code}. The loaded WebAssembly file is likely out of sync with the generated JavaScript.`); return ASM_CONSTS[code].apply(null, args); }; var _emscripten_asm_const_int = (code, sigPtr, argbuf) => { @@ -3721,11 +4263,20 @@ var ASM_CONSTS = { } quit_(code, new ExitStatus(code)); }; + /** @suppress {duplicate } */ /** @param {boolean|number=} implicit */ var exitJS = (status, implicit) => { EXITSTATUS = status; + checkUnflushedContent(); + + // if exit() was called explicitly, warn the user if the runtime isn't actually being shut down + if (keepRuntimeAlive() && !implicit) { + var msg = `program exited (with status: ${status}), but keepRuntimeAlive() is set (counter=${runtimeKeepaliveCounter}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`; + err(msg); + } + _proc_exit(status); }; var _exit = exitJS; @@ -3735,7 +4286,9 @@ var ASM_CONSTS = { runtimeKeepaliveCounter = 0; }; + var _emscripten_force_exit = (status) => { + warnOnce('emscripten_force_exit cannot actually shut down the runtime, as the build does not have EXIT_RUNTIME set'); __emscripten_runtime_keepalive_clear(); _exit(status); }; @@ -3765,6 +4318,7 @@ var ASM_CONSTS = { updateMemoryViews(); return 1 /*success*/; } catch(e) { + err(`growMemory: Attempted to grow heap from ${b.byteLength} bytes to ${size} bytes, but got error: ${e}`); } // implicit 0 return to save code size (caller will cast "undefined" into 0 // anyhow) @@ -3775,6 +4329,7 @@ var ASM_CONSTS = { requestedSize >>>= 0; // With multithreaded builds, races can happen (another thread might increase the size // in between), so return a failure, and let the caller retry. + assert(requestedSize > oldSize); // Memory resize rules: // 1. Always increase heap size to at least the requested size, rounded up @@ -3797,6 +4352,7 @@ var ASM_CONSTS = { // (the wasm binary specifies it, so if we tried, we'd fail anyhow). var maxHeapSize = getHeapMax(); if (requestedSize > maxHeapSize) { + err(`Cannot enlarge memory, requested ${requestedSize} bytes, but the limit is ${maxHeapSize} bytes!`); return false; } @@ -3818,6 +4374,7 @@ var ASM_CONSTS = { return true; } } + err(`Failed to grow the heap from ${oldSize} bytes to ${newSize} bytes, not enough memory!`); return false; }; @@ -3866,6 +4423,8 @@ var ASM_CONSTS = { var convertI32PairToI53Checked = (lo, hi) => { + assert(lo == (lo >>> 0) || lo == (lo|0)); // lo should either be a i32 or a u32 + assert(hi === (hi|0)); // hi should be a i32 return ((hi + 0x200000) >>> 0 < 0x400001 - !!lo) ? (lo >>> 0) + hi * 4294967296 : NaN; }; function _fd_seek(fd,offset_low, offset_high,whence,newOffset) { @@ -3985,6 +4544,132 @@ var ASM_CONSTS = { FS.FSNode = FSNode; FS.createPreloadedFile = FS_createPreloadedFile; FS.staticInit();; +ERRNO_CODES = { + 'EPERM': 63, + 'ENOENT': 44, + 'ESRCH': 71, + 'EINTR': 27, + 'EIO': 29, + 'ENXIO': 60, + 'E2BIG': 1, + 'ENOEXEC': 45, + 'EBADF': 8, + 'ECHILD': 12, + 'EAGAIN': 6, + 'EWOULDBLOCK': 6, + 'ENOMEM': 48, + 'EACCES': 2, + 'EFAULT': 21, + 'ENOTBLK': 105, + 'EBUSY': 10, + 'EEXIST': 20, + 'EXDEV': 75, + 'ENODEV': 43, + 'ENOTDIR': 54, + 'EISDIR': 31, + 'EINVAL': 28, + 'ENFILE': 41, + 'EMFILE': 33, + 'ENOTTY': 59, + 'ETXTBSY': 74, + 'EFBIG': 22, + 'ENOSPC': 51, + 'ESPIPE': 70, + 'EROFS': 69, + 'EMLINK': 34, + 'EPIPE': 64, + 'EDOM': 18, + 'ERANGE': 68, + 'ENOMSG': 49, + 'EIDRM': 24, + 'ECHRNG': 106, + 'EL2NSYNC': 156, + 'EL3HLT': 107, + 'EL3RST': 108, + 'ELNRNG': 109, + 'EUNATCH': 110, + 'ENOCSI': 111, + 'EL2HLT': 112, + 'EDEADLK': 16, + 'ENOLCK': 46, + 'EBADE': 113, + 'EBADR': 114, + 'EXFULL': 115, + 'ENOANO': 104, + 'EBADRQC': 103, + 'EBADSLT': 102, + 'EDEADLOCK': 16, + 'EBFONT': 101, + 'ENOSTR': 100, + 'ENODATA': 116, + 'ETIME': 117, + 'ENOSR': 118, + 'ENONET': 119, + 'ENOPKG': 120, + 'EREMOTE': 121, + 'ENOLINK': 47, + 'EADV': 122, + 'ESRMNT': 123, + 'ECOMM': 124, + 'EPROTO': 65, + 'EMULTIHOP': 36, + 'EDOTDOT': 125, + 'EBADMSG': 9, + 'ENOTUNIQ': 126, + 'EBADFD': 127, + 'EREMCHG': 128, + 'ELIBACC': 129, + 'ELIBBAD': 130, + 'ELIBSCN': 131, + 'ELIBMAX': 132, + 'ELIBEXEC': 133, + 'ENOSYS': 52, + 'ENOTEMPTY': 55, + 'ENAMETOOLONG': 37, + 'ELOOP': 32, + 'EOPNOTSUPP': 138, + 'EPFNOSUPPORT': 139, + 'ECONNRESET': 15, + 'ENOBUFS': 42, + 'EAFNOSUPPORT': 5, + 'EPROTOTYPE': 67, + 'ENOTSOCK': 57, + 'ENOPROTOOPT': 50, + 'ESHUTDOWN': 140, + 'ECONNREFUSED': 14, + 'EADDRINUSE': 3, + 'ECONNABORTED': 13, + 'ENETUNREACH': 40, + 'ENETDOWN': 38, + 'ETIMEDOUT': 73, + 'EHOSTDOWN': 142, + 'EHOSTUNREACH': 23, + 'EINPROGRESS': 26, + 'EALREADY': 7, + 'EDESTADDRREQ': 17, + 'EMSGSIZE': 35, + 'EPROTONOSUPPORT': 66, + 'ESOCKTNOSUPPORT': 137, + 'EADDRNOTAVAIL': 4, + 'ENETRESET': 39, + 'EISCONN': 30, + 'ENOTCONN': 53, + 'ETOOMANYREFS': 141, + 'EUSERS': 136, + 'EDQUOT': 19, + 'ESTALE': 72, + 'ENOTSUP': 138, + 'ENOMEDIUM': 148, + 'EILSEQ': 25, + 'EOVERFLOW': 61, + 'ECANCELED': 11, + 'ENOTRECOVERABLE': 56, + 'EOWNERDEAD': 62, + 'ESTRPIPE': 135, + };; +function checkIncomingModuleAPI() { + ignoredModuleProp('fetchSettings'); +} var wasmImports = { /** @export */ __assert_fail: ___assert_fail, @@ -4024,159 +4709,165 @@ var wasmImports = { fd_write: _fd_write }; var wasmExports = createWasm(); -var ___wasm_call_ctors = () => (___wasm_call_ctors = wasmExports['__wasm_call_ctors'])(); -var _lvglSetEncoderGroup = Module['_lvglSetEncoderGroup'] = (a0) => (_lvglSetEncoderGroup = Module['_lvglSetEncoderGroup'] = wasmExports['lvglSetEncoderGroup'])(a0); -var _lvglSetKeyboardGroup = Module['_lvglSetKeyboardGroup'] = (a0) => (_lvglSetKeyboardGroup = Module['_lvglSetKeyboardGroup'] = wasmExports['lvglSetKeyboardGroup'])(a0); -var _init = Module['_init'] = (a0, a1, a2, a3, a4, a5, a6, a7) => (_init = Module['_init'] = wasmExports['init'])(a0, a1, a2, a3, a4, a5, a6, a7); -var _malloc = Module['_malloc'] = (a0) => (_malloc = Module['_malloc'] = wasmExports['malloc'])(a0); -var _mainLoop = Module['_mainLoop'] = () => (_mainLoop = Module['_mainLoop'] = wasmExports['mainLoop'])(); -var _getSyncedBuffer = Module['_getSyncedBuffer'] = () => (_getSyncedBuffer = Module['_getSyncedBuffer'] = wasmExports['getSyncedBuffer'])(); -var _isRTL = Module['_isRTL'] = () => (_isRTL = Module['_isRTL'] = wasmExports['isRTL'])(); -var _onPointerEvent = Module['_onPointerEvent'] = (a0, a1, a2) => (_onPointerEvent = Module['_onPointerEvent'] = wasmExports['onPointerEvent'])(a0, a1, a2); -var _onMouseWheelEvent = Module['_onMouseWheelEvent'] = (a0, a1) => (_onMouseWheelEvent = Module['_onMouseWheelEvent'] = wasmExports['onMouseWheelEvent'])(a0, a1); -var _onKeyPressed = Module['_onKeyPressed'] = (a0) => (_onKeyPressed = Module['_onKeyPressed'] = wasmExports['onKeyPressed'])(a0); -var _stopScript = Module['_stopScript'] = () => (_stopScript = Module['_stopScript'] = wasmExports['stopScript'])(); -var _onMessageFromDebugger = Module['_onMessageFromDebugger'] = (a0, a1) => (_onMessageFromDebugger = Module['_onMessageFromDebugger'] = wasmExports['onMessageFromDebugger'])(a0, a1); -var _lvglGetFlowState = Module['_lvglGetFlowState'] = (a0, a1) => (_lvglGetFlowState = Module['_lvglGetFlowState'] = wasmExports['lvglGetFlowState'])(a0, a1); -var _setDebuggerMessageSubsciptionFilter = Module['_setDebuggerMessageSubsciptionFilter'] = (a0) => (_setDebuggerMessageSubsciptionFilter = Module['_setDebuggerMessageSubsciptionFilter'] = wasmExports['setDebuggerMessageSubsciptionFilter'])(a0); -var _lvglCreateGroup = Module['_lvglCreateGroup'] = () => (_lvglCreateGroup = Module['_lvglCreateGroup'] = wasmExports['lvglCreateGroup'])(); -var _lvglAddScreenLoadedEventHandler = Module['_lvglAddScreenLoadedEventHandler'] = (a0) => (_lvglAddScreenLoadedEventHandler = Module['_lvglAddScreenLoadedEventHandler'] = wasmExports['lvglAddScreenLoadedEventHandler'])(a0); -var _lvglGroupAddObject = Module['_lvglGroupAddObject'] = (a0, a1, a2) => (_lvglGroupAddObject = Module['_lvglGroupAddObject'] = wasmExports['lvglGroupAddObject'])(a0, a1, a2); -var _lvglCreateScreen = Module['_lvglCreateScreen'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateScreen = Module['_lvglCreateScreen'] = wasmExports['lvglCreateScreen'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateContainer = Module['_lvglCreateContainer'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateContainer = Module['_lvglCreateContainer'] = wasmExports['lvglCreateContainer'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateLabel = Module['_lvglCreateLabel'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8) => (_lvglCreateLabel = Module['_lvglCreateLabel'] = wasmExports['lvglCreateLabel'])(a0, a1, a2, a3, a4, a5, a6, a7, a8); -var _free = Module['_free'] = (a0) => (_free = Module['_free'] = wasmExports['free'])(a0); -var _lvglCreateButton = Module['_lvglCreateButton'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateButton = Module['_lvglCreateButton'] = wasmExports['lvglCreateButton'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateButtonMatrix = Module['_lvglCreateButtonMatrix'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8) => (_lvglCreateButtonMatrix = Module['_lvglCreateButtonMatrix'] = wasmExports['lvglCreateButtonMatrix'])(a0, a1, a2, a3, a4, a5, a6, a7, a8); -var _lvglCreatePanel = Module['_lvglCreatePanel'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreatePanel = Module['_lvglCreatePanel'] = wasmExports['lvglCreatePanel'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateUserWidget = Module['_lvglCreateUserWidget'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateUserWidget = Module['_lvglCreateUserWidget'] = wasmExports['lvglCreateUserWidget'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateImage = Module['_lvglCreateImage'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) => (_lvglCreateImage = Module['_lvglCreateImage'] = wasmExports['lvglCreateImage'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); -var _lvglSetImageSrc = Module['_lvglSetImageSrc'] = (a0, a1, a2, a3, a4, a5, a6, a7) => (_lvglSetImageSrc = Module['_lvglSetImageSrc'] = wasmExports['lvglSetImageSrc'])(a0, a1, a2, a3, a4, a5, a6, a7); -var _lvglCreateLine = Module['_lvglCreateLine'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateLine = Module['_lvglCreateLine'] = wasmExports['lvglCreateLine'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateSlider = Module['_lvglCreateSlider'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) => (_lvglCreateSlider = Module['_lvglCreateSlider'] = wasmExports['lvglCreateSlider'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); -var _lvglCreateRoller = Module['_lvglCreateRoller'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8) => (_lvglCreateRoller = Module['_lvglCreateRoller'] = wasmExports['lvglCreateRoller'])(a0, a1, a2, a3, a4, a5, a6, a7, a8); -var _lvglCreateSwitch = Module['_lvglCreateSwitch'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateSwitch = Module['_lvglCreateSwitch'] = wasmExports['lvglCreateSwitch'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateBar = Module['_lvglCreateBar'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) => (_lvglCreateBar = Module['_lvglCreateBar'] = wasmExports['lvglCreateBar'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); -var _lvglCreateDropdown = Module['_lvglCreateDropdown'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8) => (_lvglCreateDropdown = Module['_lvglCreateDropdown'] = wasmExports['lvglCreateDropdown'])(a0, a1, a2, a3, a4, a5, a6, a7, a8); -var _lvglDropdownGetList = Module['_lvglDropdownGetList'] = (a0, a1) => (_lvglDropdownGetList = Module['_lvglDropdownGetList'] = wasmExports['lvglDropdownGetList'])(a0, a1); -var _lvglCreateArc = Module['_lvglCreateArc'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) => (_lvglCreateArc = Module['_lvglCreateArc'] = wasmExports['lvglCreateArc'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); -var _lvglCreateSpinner = Module['_lvglCreateSpinner'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateSpinner = Module['_lvglCreateSpinner'] = wasmExports['lvglCreateSpinner'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateCheckbox = Module['_lvglCreateCheckbox'] = (a0, a1, a2, a3, a4, a5, a6) => (_lvglCreateCheckbox = Module['_lvglCreateCheckbox'] = wasmExports['lvglCreateCheckbox'])(a0, a1, a2, a3, a4, a5, a6); -var _lvglCreateTextarea = Module['_lvglCreateTextarea'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) => (_lvglCreateTextarea = Module['_lvglCreateTextarea'] = wasmExports['lvglCreateTextarea'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); -var _lvglCreateCalendar = Module['_lvglCreateCalendar'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) => (_lvglCreateCalendar = Module['_lvglCreateCalendar'] = wasmExports['lvglCreateCalendar'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); -var _lvglCreateColorwheel = Module['_lvglCreateColorwheel'] = (a0, a1, a2, a3, a4, a5, a6, a7) => (_lvglCreateColorwheel = Module['_lvglCreateColorwheel'] = wasmExports['lvglCreateColorwheel'])(a0, a1, a2, a3, a4, a5, a6, a7); -var _lvglCreateImgbutton = Module['_lvglCreateImgbutton'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateImgbutton = Module['_lvglCreateImgbutton'] = wasmExports['lvglCreateImgbutton'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateKeyboard = Module['_lvglCreateKeyboard'] = (a0, a1, a2, a3, a4, a5, a6) => (_lvglCreateKeyboard = Module['_lvglCreateKeyboard'] = wasmExports['lvglCreateKeyboard'])(a0, a1, a2, a3, a4, a5, a6); -var _lvglCreateChart = Module['_lvglCreateChart'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateChart = Module['_lvglCreateChart'] = wasmExports['lvglCreateChart'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateMeter = Module['_lvglCreateMeter'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateMeter = Module['_lvglCreateMeter'] = wasmExports['lvglCreateMeter'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateScale = Module['_lvglCreateScale'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) => (_lvglCreateScale = Module['_lvglCreateScale'] = wasmExports['lvglCreateScale'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); -var _lvglCreateTabview = Module['_lvglCreateTabview'] = (a0, a1, a2, a3, a4, a5, a6, a7) => (_lvglCreateTabview = Module['_lvglCreateTabview'] = wasmExports['lvglCreateTabview'])(a0, a1, a2, a3, a4, a5, a6, a7); -var _lvglTabviewAddTab = Module['_lvglTabviewAddTab'] = (a0, a1, a2) => (_lvglTabviewAddTab = Module['_lvglTabviewAddTab'] = wasmExports['lvglTabviewAddTab'])(a0, a1, a2); -var _lvglCreateAnimationImage = Module['_lvglCreateAnimationImage'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) => (_lvglCreateAnimationImage = Module['_lvglCreateAnimationImage'] = wasmExports['lvglCreateAnimationImage'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); -var _lvglCreateCanvas = Module['_lvglCreateCanvas'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateCanvas = Module['_lvglCreateCanvas'] = wasmExports['lvglCreateCanvas'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateLed = Module['_lvglCreateLed'] = (a0, a1, a2, a3, a4, a5, a6, a7) => (_lvglCreateLed = Module['_lvglCreateLed'] = wasmExports['lvglCreateLed'])(a0, a1, a2, a3, a4, a5, a6, a7); -var _lvglLedSetColor = Module['_lvglLedSetColor'] = (a0, a1) => (_lvglLedSetColor = Module['_lvglLedSetColor'] = wasmExports['lvglLedSetColor'])(a0, a1); -var _lvglUpdateLedColor = Module['_lvglUpdateLedColor'] = (a0, a1, a2, a3) => (_lvglUpdateLedColor = Module['_lvglUpdateLedColor'] = wasmExports['lvglUpdateLedColor'])(a0, a1, a2, a3); -var _lvglUpdateLedBrightness = Module['_lvglUpdateLedBrightness'] = (a0, a1, a2, a3) => (_lvglUpdateLedBrightness = Module['_lvglUpdateLedBrightness'] = wasmExports['lvglUpdateLedBrightness'])(a0, a1, a2, a3); -var _lvglCreateList = Module['_lvglCreateList'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateList = Module['_lvglCreateList'] = wasmExports['lvglCreateList'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateLottie = Module['_lvglCreateLottie'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateLottie = Module['_lvglCreateLottie'] = wasmExports['lvglCreateLottie'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateMenu = Module['_lvglCreateMenu'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateMenu = Module['_lvglCreateMenu'] = wasmExports['lvglCreateMenu'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateMessageBox = Module['_lvglCreateMessageBox'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateMessageBox = Module['_lvglCreateMessageBox'] = wasmExports['lvglCreateMessageBox'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateSpan = Module['_lvglCreateSpan'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateSpan = Module['_lvglCreateSpan'] = wasmExports['lvglCreateSpan'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateSpinbox = Module['_lvglCreateSpinbox'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) => (_lvglCreateSpinbox = Module['_lvglCreateSpinbox'] = wasmExports['lvglCreateSpinbox'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); -var _lvglUpdateSpinboxValue = Module['_lvglUpdateSpinboxValue'] = (a0, a1, a2, a3) => (_lvglUpdateSpinboxValue = Module['_lvglUpdateSpinboxValue'] = wasmExports['lvglUpdateSpinboxValue'])(a0, a1, a2, a3); -var _lvglUpdateSpinboxStep = Module['_lvglUpdateSpinboxStep'] = (a0, a1, a2, a3) => (_lvglUpdateSpinboxStep = Module['_lvglUpdateSpinboxStep'] = wasmExports['lvglUpdateSpinboxStep'])(a0, a1, a2, a3); -var _lvglCreateTable = Module['_lvglCreateTable'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateTable = Module['_lvglCreateTable'] = wasmExports['lvglCreateTable'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateTileView = Module['_lvglCreateTileView'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateTileView = Module['_lvglCreateTileView'] = wasmExports['lvglCreateTileView'])(a0, a1, a2, a3, a4, a5); -var _lvglCreateWindow = Module['_lvglCreateWindow'] = (a0, a1, a2, a3, a4, a5) => (_lvglCreateWindow = Module['_lvglCreateWindow'] = wasmExports['lvglCreateWindow'])(a0, a1, a2, a3, a4, a5); -var _lvglScreenLoad = Module['_lvglScreenLoad'] = (a0, a1) => (_lvglScreenLoad = Module['_lvglScreenLoad'] = wasmExports['lvglScreenLoad'])(a0, a1); -var _lvglDeleteObject = Module['_lvglDeleteObject'] = (a0) => (_lvglDeleteObject = Module['_lvglDeleteObject'] = wasmExports['lvglDeleteObject'])(a0); -var _lvglObjAddFlag = Module['_lvglObjAddFlag'] = (a0, a1) => (_lvglObjAddFlag = Module['_lvglObjAddFlag'] = wasmExports['lvglObjAddFlag'])(a0, a1); -var _lvglObjClearFlag = Module['_lvglObjClearFlag'] = (a0, a1) => (_lvglObjClearFlag = Module['_lvglObjClearFlag'] = wasmExports['lvglObjClearFlag'])(a0, a1); -var _lvglObjHasFlag = Module['_lvglObjHasFlag'] = (a0, a1) => (_lvglObjHasFlag = Module['_lvglObjHasFlag'] = wasmExports['lvglObjHasFlag'])(a0, a1); -var _lvglObjAddState = Module['_lvglObjAddState'] = (a0, a1) => (_lvglObjAddState = Module['_lvglObjAddState'] = wasmExports['lvglObjAddState'])(a0, a1); -var _lvglObjClearState = Module['_lvglObjClearState'] = (a0, a1) => (_lvglObjClearState = Module['_lvglObjClearState'] = wasmExports['lvglObjClearState'])(a0, a1); -var _lvglObjGetStylePropColor = Module['_lvglObjGetStylePropColor'] = (a0, a1, a2, a3) => (_lvglObjGetStylePropColor = Module['_lvglObjGetStylePropColor'] = wasmExports['lvglObjGetStylePropColor'])(a0, a1, a2, a3); -var _lvglObjGetStylePropNum = Module['_lvglObjGetStylePropNum'] = (a0, a1, a2, a3) => (_lvglObjGetStylePropNum = Module['_lvglObjGetStylePropNum'] = wasmExports['lvglObjGetStylePropNum'])(a0, a1, a2, a3); -var _lvglObjSetLocalStylePropColor = Module['_lvglObjSetLocalStylePropColor'] = (a0, a1, a2, a3) => (_lvglObjSetLocalStylePropColor = Module['_lvglObjSetLocalStylePropColor'] = wasmExports['lvglObjSetLocalStylePropColor'])(a0, a1, a2, a3); -var _lvglObjSetLocalStylePropNum = Module['_lvglObjSetLocalStylePropNum'] = (a0, a1, a2, a3) => (_lvglObjSetLocalStylePropNum = Module['_lvglObjSetLocalStylePropNum'] = wasmExports['lvglObjSetLocalStylePropNum'])(a0, a1, a2, a3); -var _lvglObjSetLocalStylePropPtr = Module['_lvglObjSetLocalStylePropPtr'] = (a0, a1, a2, a3) => (_lvglObjSetLocalStylePropPtr = Module['_lvglObjSetLocalStylePropPtr'] = wasmExports['lvglObjSetLocalStylePropPtr'])(a0, a1, a2, a3); -var _lvglObjGetStylePropBuiltInFont = Module['_lvglObjGetStylePropBuiltInFont'] = (a0, a1, a2, a3) => (_lvglObjGetStylePropBuiltInFont = Module['_lvglObjGetStylePropBuiltInFont'] = wasmExports['lvglObjGetStylePropBuiltInFont'])(a0, a1, a2, a3); -var _lvglObjGetStylePropFontAddr = Module['_lvglObjGetStylePropFontAddr'] = (a0, a1, a2, a3) => (_lvglObjGetStylePropFontAddr = Module['_lvglObjGetStylePropFontAddr'] = wasmExports['lvglObjGetStylePropFontAddr'])(a0, a1, a2, a3); -var _lvglObjSetLocalStylePropBuiltInFont = Module['_lvglObjSetLocalStylePropBuiltInFont'] = (a0, a1, a2, a3) => (_lvglObjSetLocalStylePropBuiltInFont = Module['_lvglObjSetLocalStylePropBuiltInFont'] = wasmExports['lvglObjSetLocalStylePropBuiltInFont'])(a0, a1, a2, a3); -var _lvglStyleCreate = Module['_lvglStyleCreate'] = () => (_lvglStyleCreate = Module['_lvglStyleCreate'] = wasmExports['lvglStyleCreate'])(); -var _lvglStyleSetPropColor = Module['_lvglStyleSetPropColor'] = (a0, a1, a2) => (_lvglStyleSetPropColor = Module['_lvglStyleSetPropColor'] = wasmExports['lvglStyleSetPropColor'])(a0, a1, a2); -var _lvglSetStylePropBuiltInFont = Module['_lvglSetStylePropBuiltInFont'] = (a0, a1, a2) => (_lvglSetStylePropBuiltInFont = Module['_lvglSetStylePropBuiltInFont'] = wasmExports['lvglSetStylePropBuiltInFont'])(a0, a1, a2); -var _lvglSetStylePropPtr = Module['_lvglSetStylePropPtr'] = (a0, a1, a2) => (_lvglSetStylePropPtr = Module['_lvglSetStylePropPtr'] = wasmExports['lvglSetStylePropPtr'])(a0, a1, a2); -var _lvglSetStylePropNum = Module['_lvglSetStylePropNum'] = (a0, a1, a2) => (_lvglSetStylePropNum = Module['_lvglSetStylePropNum'] = wasmExports['lvglSetStylePropNum'])(a0, a1, a2); -var _lvglStyleDelete = Module['_lvglStyleDelete'] = (a0) => (_lvglStyleDelete = Module['_lvglStyleDelete'] = wasmExports['lvglStyleDelete'])(a0); -var _lvglObjAddStyle = Module['_lvglObjAddStyle'] = (a0, a1, a2) => (_lvglObjAddStyle = Module['_lvglObjAddStyle'] = wasmExports['lvglObjAddStyle'])(a0, a1, a2); -var _lvglObjRemoveStyle = Module['_lvglObjRemoveStyle'] = (a0, a1, a2) => (_lvglObjRemoveStyle = Module['_lvglObjRemoveStyle'] = wasmExports['lvglObjRemoveStyle'])(a0, a1, a2); -var _lvglGetObjRelX = Module['_lvglGetObjRelX'] = (a0) => (_lvglGetObjRelX = Module['_lvglGetObjRelX'] = wasmExports['lvglGetObjRelX'])(a0); -var _lvglGetObjRelY = Module['_lvglGetObjRelY'] = (a0) => (_lvglGetObjRelY = Module['_lvglGetObjRelY'] = wasmExports['lvglGetObjRelY'])(a0); -var _lvglGetObjWidth = Module['_lvglGetObjWidth'] = (a0) => (_lvglGetObjWidth = Module['_lvglGetObjWidth'] = wasmExports['lvglGetObjWidth'])(a0); -var _lvglGetObjHeight = Module['_lvglGetObjHeight'] = (a0) => (_lvglGetObjHeight = Module['_lvglGetObjHeight'] = wasmExports['lvglGetObjHeight'])(a0); -var _lvglLoadFont = Module['_lvglLoadFont'] = (a0) => (_lvglLoadFont = Module['_lvglLoadFont'] = wasmExports['lvglLoadFont'])(a0); -var _lvglFreeFont = Module['_lvglFreeFont'] = (a0) => (_lvglFreeFont = Module['_lvglFreeFont'] = wasmExports['lvglFreeFont'])(a0); -var _lvglAddObjectFlowCallback = Module['_lvglAddObjectFlowCallback'] = (a0, a1, a2, a3, a4, a5) => (_lvglAddObjectFlowCallback = Module['_lvglAddObjectFlowCallback'] = wasmExports['lvglAddObjectFlowCallback'])(a0, a1, a2, a3, a4, a5); -var _lvglUpdateLabelText = Module['_lvglUpdateLabelText'] = (a0, a1, a2, a3) => (_lvglUpdateLabelText = Module['_lvglUpdateLabelText'] = wasmExports['lvglUpdateLabelText'])(a0, a1, a2, a3); -var _lvglSetImgbuttonImageSrc = Module['_lvglSetImgbuttonImageSrc'] = (a0, a1, a2) => (_lvglSetImgbuttonImageSrc = Module['_lvglSetImgbuttonImageSrc'] = wasmExports['lvglSetImgbuttonImageSrc'])(a0, a1, a2); -var _lvglSetKeyboardTextarea = Module['_lvglSetKeyboardTextarea'] = (a0, a1) => (_lvglSetKeyboardTextarea = Module['_lvglSetKeyboardTextarea'] = wasmExports['lvglSetKeyboardTextarea'])(a0, a1); -var _lvglMeterAddScale = Module['_lvglMeterAddScale'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) => (_lvglMeterAddScale = Module['_lvglMeterAddScale'] = wasmExports['lvglMeterAddScale'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); -var _lvglMeterAddIndicatorNeedleImg = Module['_lvglMeterAddIndicatorNeedleImg'] = (a0, a1, a2, a3, a4, a5) => (_lvglMeterAddIndicatorNeedleImg = Module['_lvglMeterAddIndicatorNeedleImg'] = wasmExports['lvglMeterAddIndicatorNeedleImg'])(a0, a1, a2, a3, a4, a5); -var _lvglMeterAddIndicatorNeedleLine = Module['_lvglMeterAddIndicatorNeedleLine'] = (a0, a1, a2, a3, a4, a5) => (_lvglMeterAddIndicatorNeedleLine = Module['_lvglMeterAddIndicatorNeedleLine'] = wasmExports['lvglMeterAddIndicatorNeedleLine'])(a0, a1, a2, a3, a4, a5); -var _lvglMeterAddIndicatorScaleLines = Module['_lvglMeterAddIndicatorScaleLines'] = (a0, a1, a2, a3, a4, a5, a6, a7) => (_lvglMeterAddIndicatorScaleLines = Module['_lvglMeterAddIndicatorScaleLines'] = wasmExports['lvglMeterAddIndicatorScaleLines'])(a0, a1, a2, a3, a4, a5, a6, a7); -var _lvglMeterAddIndicatorArc = Module['_lvglMeterAddIndicatorArc'] = (a0, a1, a2, a3, a4, a5, a6) => (_lvglMeterAddIndicatorArc = Module['_lvglMeterAddIndicatorArc'] = wasmExports['lvglMeterAddIndicatorArc'])(a0, a1, a2, a3, a4, a5, a6); -var _lvglUpdateMeterIndicatorValue = Module['_lvglUpdateMeterIndicatorValue'] = (a0, a1, a2, a3, a4) => (_lvglUpdateMeterIndicatorValue = Module['_lvglUpdateMeterIndicatorValue'] = wasmExports['lvglUpdateMeterIndicatorValue'])(a0, a1, a2, a3, a4); -var _lvglUpdateMeterIndicatorStartValue = Module['_lvglUpdateMeterIndicatorStartValue'] = (a0, a1, a2, a3, a4) => (_lvglUpdateMeterIndicatorStartValue = Module['_lvglUpdateMeterIndicatorStartValue'] = wasmExports['lvglUpdateMeterIndicatorStartValue'])(a0, a1, a2, a3, a4); -var _lvglUpdateMeterIndicatorEndValue = Module['_lvglUpdateMeterIndicatorEndValue'] = (a0, a1, a2, a3, a4) => (_lvglUpdateMeterIndicatorEndValue = Module['_lvglUpdateMeterIndicatorEndValue'] = wasmExports['lvglUpdateMeterIndicatorEndValue'])(a0, a1, a2, a3, a4); -var _lvglMeterIndicatorNeedleLineSetColor = Module['_lvglMeterIndicatorNeedleLineSetColor'] = (a0, a1, a2) => (_lvglMeterIndicatorNeedleLineSetColor = Module['_lvglMeterIndicatorNeedleLineSetColor'] = wasmExports['lvglMeterIndicatorNeedleLineSetColor'])(a0, a1, a2); -var _lvglMeterIndicatorScaleLinesSetColorStart = Module['_lvglMeterIndicatorScaleLinesSetColorStart'] = (a0, a1, a2) => (_lvglMeterIndicatorScaleLinesSetColorStart = Module['_lvglMeterIndicatorScaleLinesSetColorStart'] = wasmExports['lvglMeterIndicatorScaleLinesSetColorStart'])(a0, a1, a2); -var _lvglMeterIndicatorScaleLinesSetColorEnd = Module['_lvglMeterIndicatorScaleLinesSetColorEnd'] = (a0, a1, a2) => (_lvglMeterIndicatorScaleLinesSetColorEnd = Module['_lvglMeterIndicatorScaleLinesSetColorEnd'] = wasmExports['lvglMeterIndicatorScaleLinesSetColorEnd'])(a0, a1, a2); -var _lvglMeterIndicatorArcSetColor = Module['_lvglMeterIndicatorArcSetColor'] = (a0, a1, a2) => (_lvglMeterIndicatorArcSetColor = Module['_lvglMeterIndicatorArcSetColor'] = wasmExports['lvglMeterIndicatorArcSetColor'])(a0, a1, a2); -var _lvglMeterScaleSetMinorTickColor = Module['_lvglMeterScaleSetMinorTickColor'] = (a0, a1, a2) => (_lvglMeterScaleSetMinorTickColor = Module['_lvglMeterScaleSetMinorTickColor'] = wasmExports['lvglMeterScaleSetMinorTickColor'])(a0, a1, a2); -var _lvglMeterScaleSetMajorTickColor = Module['_lvglMeterScaleSetMajorTickColor'] = (a0, a1, a2) => (_lvglMeterScaleSetMajorTickColor = Module['_lvglMeterScaleSetMajorTickColor'] = wasmExports['lvglMeterScaleSetMajorTickColor'])(a0, a1, a2); -var _lvglUpdateDropdownOptions = Module['_lvglUpdateDropdownOptions'] = (a0, a1, a2, a3) => (_lvglUpdateDropdownOptions = Module['_lvglUpdateDropdownOptions'] = wasmExports['lvglUpdateDropdownOptions'])(a0, a1, a2, a3); -var _lvglUpdateDropdownSelected = Module['_lvglUpdateDropdownSelected'] = (a0, a1, a2, a3) => (_lvglUpdateDropdownSelected = Module['_lvglUpdateDropdownSelected'] = wasmExports['lvglUpdateDropdownSelected'])(a0, a1, a2, a3); -var _lvglUpdateRollerOptions = Module['_lvglUpdateRollerOptions'] = (a0, a1, a2, a3, a4) => (_lvglUpdateRollerOptions = Module['_lvglUpdateRollerOptions'] = wasmExports['lvglUpdateRollerOptions'])(a0, a1, a2, a3, a4); -var _lvglUpdateRollerSelected = Module['_lvglUpdateRollerSelected'] = (a0, a1, a2, a3) => (_lvglUpdateRollerSelected = Module['_lvglUpdateRollerSelected'] = wasmExports['lvglUpdateRollerSelected'])(a0, a1, a2, a3); -var _lvglUpdateSliderValue = Module['_lvglUpdateSliderValue'] = (a0, a1, a2, a3, a4) => (_lvglUpdateSliderValue = Module['_lvglUpdateSliderValue'] = wasmExports['lvglUpdateSliderValue'])(a0, a1, a2, a3, a4); -var _lvglUpdateSliderValueLeft = Module['_lvglUpdateSliderValueLeft'] = (a0, a1, a2, a3, a4) => (_lvglUpdateSliderValueLeft = Module['_lvglUpdateSliderValueLeft'] = wasmExports['lvglUpdateSliderValueLeft'])(a0, a1, a2, a3, a4); -var _lvglUpdateBarValue = Module['_lvglUpdateBarValue'] = (a0, a1, a2, a3, a4) => (_lvglUpdateBarValue = Module['_lvglUpdateBarValue'] = wasmExports['lvglUpdateBarValue'])(a0, a1, a2, a3, a4); -var _lvglUpdateBarValueStart = Module['_lvglUpdateBarValueStart'] = (a0, a1, a2, a3, a4) => (_lvglUpdateBarValueStart = Module['_lvglUpdateBarValueStart'] = wasmExports['lvglUpdateBarValueStart'])(a0, a1, a2, a3, a4); -var _lvglUpdateArcRangeMin = Module['_lvglUpdateArcRangeMin'] = (a0, a1, a2, a3) => (_lvglUpdateArcRangeMin = Module['_lvglUpdateArcRangeMin'] = wasmExports['lvglUpdateArcRangeMin'])(a0, a1, a2, a3); -var _lvglUpdateArcRangeMax = Module['_lvglUpdateArcRangeMax'] = (a0, a1, a2, a3) => (_lvglUpdateArcRangeMax = Module['_lvglUpdateArcRangeMax'] = wasmExports['lvglUpdateArcRangeMax'])(a0, a1, a2, a3); -var _lvglUpdateArcValue = Module['_lvglUpdateArcValue'] = (a0, a1, a2, a3) => (_lvglUpdateArcValue = Module['_lvglUpdateArcValue'] = wasmExports['lvglUpdateArcValue'])(a0, a1, a2, a3); -var _lvglUpdateTextareaText = Module['_lvglUpdateTextareaText'] = (a0, a1, a2, a3) => (_lvglUpdateTextareaText = Module['_lvglUpdateTextareaText'] = wasmExports['lvglUpdateTextareaText'])(a0, a1, a2, a3); -var _lvglUpdateCheckedState = Module['_lvglUpdateCheckedState'] = (a0, a1, a2, a3) => (_lvglUpdateCheckedState = Module['_lvglUpdateCheckedState'] = wasmExports['lvglUpdateCheckedState'])(a0, a1, a2, a3); -var _lvglUpdateDisabledState = Module['_lvglUpdateDisabledState'] = (a0, a1, a2, a3) => (_lvglUpdateDisabledState = Module['_lvglUpdateDisabledState'] = wasmExports['lvglUpdateDisabledState'])(a0, a1, a2, a3); -var _lvglUpdateHiddenFlag = Module['_lvglUpdateHiddenFlag'] = (a0, a1, a2, a3) => (_lvglUpdateHiddenFlag = Module['_lvglUpdateHiddenFlag'] = wasmExports['lvglUpdateHiddenFlag'])(a0, a1, a2, a3); -var _lvglUpdateClickableFlag = Module['_lvglUpdateClickableFlag'] = (a0, a1, a2, a3) => (_lvglUpdateClickableFlag = Module['_lvglUpdateClickableFlag'] = wasmExports['lvglUpdateClickableFlag'])(a0, a1, a2, a3); -var _lvglUpdateTabName = Module['_lvglUpdateTabName'] = (a0, a1, a2, a3, a4) => (_lvglUpdateTabName = Module['_lvglUpdateTabName'] = wasmExports['lvglUpdateTabName'])(a0, a1, a2, a3, a4); -var _lvglAddTimelineKeyframe = Module['_lvglAddTimelineKeyframe'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22) => (_lvglAddTimelineKeyframe = Module['_lvglAddTimelineKeyframe'] = wasmExports['lvglAddTimelineKeyframe'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22); -var _lvglSetTimelinePosition = Module['_lvglSetTimelinePosition'] = (a0) => (_lvglSetTimelinePosition = Module['_lvglSetTimelinePosition'] = wasmExports['lvglSetTimelinePosition'])(a0); -var _lvglClearTimeline = Module['_lvglClearTimeline'] = () => (_lvglClearTimeline = Module['_lvglClearTimeline'] = wasmExports['lvglClearTimeline'])(); -var _lvglSetScrollBarMode = Module['_lvglSetScrollBarMode'] = (a0, a1) => (_lvglSetScrollBarMode = Module['_lvglSetScrollBarMode'] = wasmExports['lvglSetScrollBarMode'])(a0, a1); -var _lvglSetScrollDir = Module['_lvglSetScrollDir'] = (a0, a1) => (_lvglSetScrollDir = Module['_lvglSetScrollDir'] = wasmExports['lvglSetScrollDir'])(a0, a1); -var _lvglSetScrollSnapX = Module['_lvglSetScrollSnapX'] = (a0, a1) => (_lvglSetScrollSnapX = Module['_lvglSetScrollSnapX'] = wasmExports['lvglSetScrollSnapX'])(a0, a1); -var _lvglSetScrollSnapY = Module['_lvglSetScrollSnapY'] = (a0, a1) => (_lvglSetScrollSnapY = Module['_lvglSetScrollSnapY'] = wasmExports['lvglSetScrollSnapY'])(a0, a1); -var _lvglTabviewSetActive = Module['_lvglTabviewSetActive'] = (a0, a1, a2) => (_lvglTabviewSetActive = Module['_lvglTabviewSetActive'] = wasmExports['lvglTabviewSetActive'])(a0, a1, a2); -var _lvglTabviewGetTabBar = Module['_lvglTabviewGetTabBar'] = (a0, a1) => (_lvglTabviewGetTabBar = Module['_lvglTabviewGetTabBar'] = wasmExports['lvglTabviewGetTabBar'])(a0, a1); -var _lvglTabviewGetTabContent = Module['_lvglTabviewGetTabContent'] = (a0, a1) => (_lvglTabviewGetTabContent = Module['_lvglTabviewGetTabContent'] = wasmExports['lvglTabviewGetTabContent'])(a0, a1); -var _lvglLineSetPoints = Module['_lvglLineSetPoints'] = (a0, a1, a2) => (_lvglLineSetPoints = Module['_lvglLineSetPoints'] = wasmExports['lvglLineSetPoints'])(a0, a1, a2); -var _lvglLineSetYInvert = Module['_lvglLineSetYInvert'] = (a0, a1) => (_lvglLineSetYInvert = Module['_lvglLineSetYInvert'] = wasmExports['lvglLineSetYInvert'])(a0, a1); -var _lvglScrollTo = Module['_lvglScrollTo'] = (a0, a1, a2, a3) => (_lvglScrollTo = Module['_lvglScrollTo'] = wasmExports['lvglScrollTo'])(a0, a1, a2, a3); -var _lvglGetScrollX = Module['_lvglGetScrollX'] = (a0) => (_lvglGetScrollX = Module['_lvglGetScrollX'] = wasmExports['lvglGetScrollX'])(a0); -var _lvglGetScrollY = Module['_lvglGetScrollY'] = (a0) => (_lvglGetScrollY = Module['_lvglGetScrollY'] = wasmExports['lvglGetScrollY'])(a0); -var _lvglObjInvalidate = Module['_lvglObjInvalidate'] = (a0) => (_lvglObjInvalidate = Module['_lvglObjInvalidate'] = wasmExports['lvglObjInvalidate'])(a0); -var _onMqttEvent = Module['_onMqttEvent'] = (a0, a1, a2, a3) => (_onMqttEvent = Module['_onMqttEvent'] = wasmExports['onMqttEvent'])(a0, a1, a2, a3); -var ___errno_location = () => (___errno_location = wasmExports['__errno_location'])(); -var stackSave = () => (stackSave = wasmExports['stackSave'])(); -var stackRestore = (a0) => (stackRestore = wasmExports['stackRestore'])(a0); -var stackAlloc = (a0) => (stackAlloc = wasmExports['stackAlloc'])(a0); -var ___cxa_demangle = (a0, a1, a2, a3) => (___cxa_demangle = wasmExports['__cxa_demangle'])(a0, a1, a2, a3); -var ___cxa_is_pointer_type = (a0) => (___cxa_is_pointer_type = wasmExports['__cxa_is_pointer_type'])(a0); -var dynCall_jiji = Module['dynCall_jiji'] = (a0, a1, a2, a3, a4) => (dynCall_jiji = Module['dynCall_jiji'] = wasmExports['dynCall_jiji'])(a0, a1, a2, a3, a4); +var ___wasm_call_ctors = createExportWrapper('__wasm_call_ctors'); +var _lvglSetEncoderGroup = Module['_lvglSetEncoderGroup'] = createExportWrapper('lvglSetEncoderGroup'); +var _lvglSetKeyboardGroup = Module['_lvglSetKeyboardGroup'] = createExportWrapper('lvglSetKeyboardGroup'); +var _init = Module['_init'] = createExportWrapper('init'); +var _malloc = Module['_malloc'] = createExportWrapper('malloc'); +var _mainLoop = Module['_mainLoop'] = createExportWrapper('mainLoop'); +var _getSyncedBuffer = Module['_getSyncedBuffer'] = createExportWrapper('getSyncedBuffer'); +var _isRTL = Module['_isRTL'] = createExportWrapper('isRTL'); +var _onPointerEvent = Module['_onPointerEvent'] = createExportWrapper('onPointerEvent'); +var _onMouseWheelEvent = Module['_onMouseWheelEvent'] = createExportWrapper('onMouseWheelEvent'); +var _onKeyPressed = Module['_onKeyPressed'] = createExportWrapper('onKeyPressed'); +var _stopScript = Module['_stopScript'] = createExportWrapper('stopScript'); +var _onMessageFromDebugger = Module['_onMessageFromDebugger'] = createExportWrapper('onMessageFromDebugger'); +var _lvglGetFlowState = Module['_lvglGetFlowState'] = createExportWrapper('lvglGetFlowState'); +var _setDebuggerMessageSubsciptionFilter = Module['_setDebuggerMessageSubsciptionFilter'] = createExportWrapper('setDebuggerMessageSubsciptionFilter'); +var _lvglCreateGroup = Module['_lvglCreateGroup'] = createExportWrapper('lvglCreateGroup'); +var _lvglAddScreenLoadedEventHandler = Module['_lvglAddScreenLoadedEventHandler'] = createExportWrapper('lvglAddScreenLoadedEventHandler'); +var _lvglGroupAddObject = Module['_lvglGroupAddObject'] = createExportWrapper('lvglGroupAddObject'); +var _lvglCreateScreen = Module['_lvglCreateScreen'] = createExportWrapper('lvglCreateScreen'); +var _lvglCreateContainer = Module['_lvglCreateContainer'] = createExportWrapper('lvglCreateContainer'); +var _lvglCreateLabel = Module['_lvglCreateLabel'] = createExportWrapper('lvglCreateLabel'); +var _free = Module['_free'] = createExportWrapper('free'); +var _lvglCreateButton = Module['_lvglCreateButton'] = createExportWrapper('lvglCreateButton'); +var _lvglCreateButtonMatrix = Module['_lvglCreateButtonMatrix'] = createExportWrapper('lvglCreateButtonMatrix'); +var _lvglCreatePanel = Module['_lvglCreatePanel'] = createExportWrapper('lvglCreatePanel'); +var _lvglCreateUserWidget = Module['_lvglCreateUserWidget'] = createExportWrapper('lvglCreateUserWidget'); +var _lvglCreateImage = Module['_lvglCreateImage'] = createExportWrapper('lvglCreateImage'); +var _lvglSetImageSrc = Module['_lvglSetImageSrc'] = createExportWrapper('lvglSetImageSrc'); +var _lvglCreateLine = Module['_lvglCreateLine'] = createExportWrapper('lvglCreateLine'); +var _lvglCreateSlider = Module['_lvglCreateSlider'] = createExportWrapper('lvglCreateSlider'); +var _lvglCreateRoller = Module['_lvglCreateRoller'] = createExportWrapper('lvglCreateRoller'); +var _lvglCreateSwitch = Module['_lvglCreateSwitch'] = createExportWrapper('lvglCreateSwitch'); +var _lvglCreateBar = Module['_lvglCreateBar'] = createExportWrapper('lvglCreateBar'); +var _lvglCreateDropdown = Module['_lvglCreateDropdown'] = createExportWrapper('lvglCreateDropdown'); +var _lvglDropdownGetList = Module['_lvglDropdownGetList'] = createExportWrapper('lvglDropdownGetList'); +var _lvglCreateArc = Module['_lvglCreateArc'] = createExportWrapper('lvglCreateArc'); +var _lvglCreateSpinner = Module['_lvglCreateSpinner'] = createExportWrapper('lvglCreateSpinner'); +var _lvglCreateCheckbox = Module['_lvglCreateCheckbox'] = createExportWrapper('lvglCreateCheckbox'); +var _lvglCreateTextarea = Module['_lvglCreateTextarea'] = createExportWrapper('lvglCreateTextarea'); +var _lvglCreateCalendar = Module['_lvglCreateCalendar'] = createExportWrapper('lvglCreateCalendar'); +var _lvglCreateColorwheel = Module['_lvglCreateColorwheel'] = createExportWrapper('lvglCreateColorwheel'); +var _lvglCreateImgbutton = Module['_lvglCreateImgbutton'] = createExportWrapper('lvglCreateImgbutton'); +var _lvglCreateKeyboard = Module['_lvglCreateKeyboard'] = createExportWrapper('lvglCreateKeyboard'); +var _lvglCreateChart = Module['_lvglCreateChart'] = createExportWrapper('lvglCreateChart'); +var _lvglCreateMeter = Module['_lvglCreateMeter'] = createExportWrapper('lvglCreateMeter'); +var _lvglCreateScale = Module['_lvglCreateScale'] = createExportWrapper('lvglCreateScale'); +var _lvglCreateTabview = Module['_lvglCreateTabview'] = createExportWrapper('lvglCreateTabview'); +var _lvglTabviewAddTab = Module['_lvglTabviewAddTab'] = createExportWrapper('lvglTabviewAddTab'); +var _lvglCreateAnimationImage = Module['_lvglCreateAnimationImage'] = createExportWrapper('lvglCreateAnimationImage'); +var _lvglCreateCanvas = Module['_lvglCreateCanvas'] = createExportWrapper('lvglCreateCanvas'); +var _lvglCreateLed = Module['_lvglCreateLed'] = createExportWrapper('lvglCreateLed'); +var _lvglLedSetColor = Module['_lvglLedSetColor'] = createExportWrapper('lvglLedSetColor'); +var _lvglUpdateLedColor = Module['_lvglUpdateLedColor'] = createExportWrapper('lvglUpdateLedColor'); +var _lvglUpdateLedBrightness = Module['_lvglUpdateLedBrightness'] = createExportWrapper('lvglUpdateLedBrightness'); +var _lvglCreateList = Module['_lvglCreateList'] = createExportWrapper('lvglCreateList'); +var _lvglCreateLottie = Module['_lvglCreateLottie'] = createExportWrapper('lvglCreateLottie'); +var _lvglCreateMenu = Module['_lvglCreateMenu'] = createExportWrapper('lvglCreateMenu'); +var _lvglCreateMessageBox = Module['_lvglCreateMessageBox'] = createExportWrapper('lvglCreateMessageBox'); +var _lvglCreateSpan = Module['_lvglCreateSpan'] = createExportWrapper('lvglCreateSpan'); +var _lvglCreateSpinbox = Module['_lvglCreateSpinbox'] = createExportWrapper('lvglCreateSpinbox'); +var _lvglUpdateSpinboxValue = Module['_lvglUpdateSpinboxValue'] = createExportWrapper('lvglUpdateSpinboxValue'); +var _lvglUpdateSpinboxStep = Module['_lvglUpdateSpinboxStep'] = createExportWrapper('lvglUpdateSpinboxStep'); +var _lvglCreateTable = Module['_lvglCreateTable'] = createExportWrapper('lvglCreateTable'); +var _lvglCreateTileView = Module['_lvglCreateTileView'] = createExportWrapper('lvglCreateTileView'); +var _lvglCreateWindow = Module['_lvglCreateWindow'] = createExportWrapper('lvglCreateWindow'); +var _lvglScreenLoad = Module['_lvglScreenLoad'] = createExportWrapper('lvglScreenLoad'); +var _lvglDeleteObject = Module['_lvglDeleteObject'] = createExportWrapper('lvglDeleteObject'); +var _lvglObjAddFlag = Module['_lvglObjAddFlag'] = createExportWrapper('lvglObjAddFlag'); +var _lvglObjClearFlag = Module['_lvglObjClearFlag'] = createExportWrapper('lvglObjClearFlag'); +var _lvglObjHasFlag = Module['_lvglObjHasFlag'] = createExportWrapper('lvglObjHasFlag'); +var _lvglObjAddState = Module['_lvglObjAddState'] = createExportWrapper('lvglObjAddState'); +var _lvglObjClearState = Module['_lvglObjClearState'] = createExportWrapper('lvglObjClearState'); +var _lvglObjGetStylePropColor = Module['_lvglObjGetStylePropColor'] = createExportWrapper('lvglObjGetStylePropColor'); +var _lvglObjGetStylePropNum = Module['_lvglObjGetStylePropNum'] = createExportWrapper('lvglObjGetStylePropNum'); +var _lvglObjSetLocalStylePropColor = Module['_lvglObjSetLocalStylePropColor'] = createExportWrapper('lvglObjSetLocalStylePropColor'); +var _lvglObjSetLocalStylePropNum = Module['_lvglObjSetLocalStylePropNum'] = createExportWrapper('lvglObjSetLocalStylePropNum'); +var _lvglObjSetLocalStylePropPtr = Module['_lvglObjSetLocalStylePropPtr'] = createExportWrapper('lvglObjSetLocalStylePropPtr'); +var _lvglObjGetStylePropBuiltInFont = Module['_lvglObjGetStylePropBuiltInFont'] = createExportWrapper('lvglObjGetStylePropBuiltInFont'); +var _lvglObjGetStylePropFontAddr = Module['_lvglObjGetStylePropFontAddr'] = createExportWrapper('lvglObjGetStylePropFontAddr'); +var _lvglObjSetLocalStylePropBuiltInFont = Module['_lvglObjSetLocalStylePropBuiltInFont'] = createExportWrapper('lvglObjSetLocalStylePropBuiltInFont'); +var _lvglStyleCreate = Module['_lvglStyleCreate'] = createExportWrapper('lvglStyleCreate'); +var _lvglStyleSetPropColor = Module['_lvglStyleSetPropColor'] = createExportWrapper('lvglStyleSetPropColor'); +var _lvglSetStylePropBuiltInFont = Module['_lvglSetStylePropBuiltInFont'] = createExportWrapper('lvglSetStylePropBuiltInFont'); +var _lvglSetStylePropPtr = Module['_lvglSetStylePropPtr'] = createExportWrapper('lvglSetStylePropPtr'); +var _lvglSetStylePropNum = Module['_lvglSetStylePropNum'] = createExportWrapper('lvglSetStylePropNum'); +var _lvglStyleDelete = Module['_lvglStyleDelete'] = createExportWrapper('lvglStyleDelete'); +var _lvglObjAddStyle = Module['_lvglObjAddStyle'] = createExportWrapper('lvglObjAddStyle'); +var _lvglObjRemoveStyle = Module['_lvglObjRemoveStyle'] = createExportWrapper('lvglObjRemoveStyle'); +var _lvglGetObjRelX = Module['_lvglGetObjRelX'] = createExportWrapper('lvglGetObjRelX'); +var _lvglGetObjRelY = Module['_lvglGetObjRelY'] = createExportWrapper('lvglGetObjRelY'); +var _lvglGetObjWidth = Module['_lvglGetObjWidth'] = createExportWrapper('lvglGetObjWidth'); +var _lvglGetObjHeight = Module['_lvglGetObjHeight'] = createExportWrapper('lvglGetObjHeight'); +var _lvglLoadFont = Module['_lvglLoadFont'] = createExportWrapper('lvglLoadFont'); +var _lvglFreeFont = Module['_lvglFreeFont'] = createExportWrapper('lvglFreeFont'); +var _lvglAddObjectFlowCallback = Module['_lvglAddObjectFlowCallback'] = createExportWrapper('lvglAddObjectFlowCallback'); +var _lvglUpdateLabelText = Module['_lvglUpdateLabelText'] = createExportWrapper('lvglUpdateLabelText'); +var _lvglSetImgbuttonImageSrc = Module['_lvglSetImgbuttonImageSrc'] = createExportWrapper('lvglSetImgbuttonImageSrc'); +var _lvglSetKeyboardTextarea = Module['_lvglSetKeyboardTextarea'] = createExportWrapper('lvglSetKeyboardTextarea'); +var _lvglMeterAddScale = Module['_lvglMeterAddScale'] = createExportWrapper('lvglMeterAddScale'); +var _lvglMeterAddIndicatorNeedleImg = Module['_lvglMeterAddIndicatorNeedleImg'] = createExportWrapper('lvglMeterAddIndicatorNeedleImg'); +var _lvglMeterAddIndicatorNeedleLine = Module['_lvglMeterAddIndicatorNeedleLine'] = createExportWrapper('lvglMeterAddIndicatorNeedleLine'); +var _lvglMeterAddIndicatorScaleLines = Module['_lvglMeterAddIndicatorScaleLines'] = createExportWrapper('lvglMeterAddIndicatorScaleLines'); +var _lvglMeterAddIndicatorArc = Module['_lvglMeterAddIndicatorArc'] = createExportWrapper('lvglMeterAddIndicatorArc'); +var _lvglUpdateMeterIndicatorValue = Module['_lvglUpdateMeterIndicatorValue'] = createExportWrapper('lvglUpdateMeterIndicatorValue'); +var _lvglUpdateMeterIndicatorStartValue = Module['_lvglUpdateMeterIndicatorStartValue'] = createExportWrapper('lvglUpdateMeterIndicatorStartValue'); +var _lvglUpdateMeterIndicatorEndValue = Module['_lvglUpdateMeterIndicatorEndValue'] = createExportWrapper('lvglUpdateMeterIndicatorEndValue'); +var _lvglMeterIndicatorNeedleLineSetColor = Module['_lvglMeterIndicatorNeedleLineSetColor'] = createExportWrapper('lvglMeterIndicatorNeedleLineSetColor'); +var _lvglMeterIndicatorScaleLinesSetColorStart = Module['_lvglMeterIndicatorScaleLinesSetColorStart'] = createExportWrapper('lvglMeterIndicatorScaleLinesSetColorStart'); +var _lvglMeterIndicatorScaleLinesSetColorEnd = Module['_lvglMeterIndicatorScaleLinesSetColorEnd'] = createExportWrapper('lvglMeterIndicatorScaleLinesSetColorEnd'); +var _lvglMeterIndicatorArcSetColor = Module['_lvglMeterIndicatorArcSetColor'] = createExportWrapper('lvglMeterIndicatorArcSetColor'); +var _lvglMeterScaleSetMinorTickColor = Module['_lvglMeterScaleSetMinorTickColor'] = createExportWrapper('lvglMeterScaleSetMinorTickColor'); +var _lvglMeterScaleSetMajorTickColor = Module['_lvglMeterScaleSetMajorTickColor'] = createExportWrapper('lvglMeterScaleSetMajorTickColor'); +var _lvglUpdateDropdownOptions = Module['_lvglUpdateDropdownOptions'] = createExportWrapper('lvglUpdateDropdownOptions'); +var _lvglUpdateDropdownSelected = Module['_lvglUpdateDropdownSelected'] = createExportWrapper('lvglUpdateDropdownSelected'); +var _lvglUpdateRollerOptions = Module['_lvglUpdateRollerOptions'] = createExportWrapper('lvglUpdateRollerOptions'); +var _lvglUpdateRollerSelected = Module['_lvglUpdateRollerSelected'] = createExportWrapper('lvglUpdateRollerSelected'); +var _lvglUpdateSliderValue = Module['_lvglUpdateSliderValue'] = createExportWrapper('lvglUpdateSliderValue'); +var _lvglUpdateSliderValueLeft = Module['_lvglUpdateSliderValueLeft'] = createExportWrapper('lvglUpdateSliderValueLeft'); +var _lvglUpdateBarValue = Module['_lvglUpdateBarValue'] = createExportWrapper('lvglUpdateBarValue'); +var _lvglUpdateBarValueStart = Module['_lvglUpdateBarValueStart'] = createExportWrapper('lvglUpdateBarValueStart'); +var _lvglUpdateArcRangeMin = Module['_lvglUpdateArcRangeMin'] = createExportWrapper('lvglUpdateArcRangeMin'); +var _lvglUpdateArcRangeMax = Module['_lvglUpdateArcRangeMax'] = createExportWrapper('lvglUpdateArcRangeMax'); +var _lvglUpdateArcValue = Module['_lvglUpdateArcValue'] = createExportWrapper('lvglUpdateArcValue'); +var _lvglUpdateTextareaText = Module['_lvglUpdateTextareaText'] = createExportWrapper('lvglUpdateTextareaText'); +var _lvglUpdateCheckedState = Module['_lvglUpdateCheckedState'] = createExportWrapper('lvglUpdateCheckedState'); +var _lvglUpdateDisabledState = Module['_lvglUpdateDisabledState'] = createExportWrapper('lvglUpdateDisabledState'); +var _lvglUpdateHiddenFlag = Module['_lvglUpdateHiddenFlag'] = createExportWrapper('lvglUpdateHiddenFlag'); +var _lvglUpdateClickableFlag = Module['_lvglUpdateClickableFlag'] = createExportWrapper('lvglUpdateClickableFlag'); +var _lvglUpdateTabName = Module['_lvglUpdateTabName'] = createExportWrapper('lvglUpdateTabName'); +var _lvglAddTimelineKeyframe = Module['_lvglAddTimelineKeyframe'] = createExportWrapper('lvglAddTimelineKeyframe'); +var _lvglSetTimelinePosition = Module['_lvglSetTimelinePosition'] = createExportWrapper('lvglSetTimelinePosition'); +var _lvglClearTimeline = Module['_lvglClearTimeline'] = createExportWrapper('lvglClearTimeline'); +var _lvglSetScrollBarMode = Module['_lvglSetScrollBarMode'] = createExportWrapper('lvglSetScrollBarMode'); +var _lvglSetScrollDir = Module['_lvglSetScrollDir'] = createExportWrapper('lvglSetScrollDir'); +var _lvglSetScrollSnapX = Module['_lvglSetScrollSnapX'] = createExportWrapper('lvglSetScrollSnapX'); +var _lvglSetScrollSnapY = Module['_lvglSetScrollSnapY'] = createExportWrapper('lvglSetScrollSnapY'); +var _lvglTabviewSetActive = Module['_lvglTabviewSetActive'] = createExportWrapper('lvglTabviewSetActive'); +var _lvglTabviewGetTabBar = Module['_lvglTabviewGetTabBar'] = createExportWrapper('lvglTabviewGetTabBar'); +var _lvglTabviewGetTabContent = Module['_lvglTabviewGetTabContent'] = createExportWrapper('lvglTabviewGetTabContent'); +var _lvglLineSetPoints = Module['_lvglLineSetPoints'] = createExportWrapper('lvglLineSetPoints'); +var _lvglLineSetYInvert = Module['_lvglLineSetYInvert'] = createExportWrapper('lvglLineSetYInvert'); +var _lvglScrollTo = Module['_lvglScrollTo'] = createExportWrapper('lvglScrollTo'); +var _lvglGetScrollX = Module['_lvglGetScrollX'] = createExportWrapper('lvglGetScrollX'); +var _lvglGetScrollY = Module['_lvglGetScrollY'] = createExportWrapper('lvglGetScrollY'); +var _lvglObjInvalidate = Module['_lvglObjInvalidate'] = createExportWrapper('lvglObjInvalidate'); +var _onMqttEvent = Module['_onMqttEvent'] = createExportWrapper('onMqttEvent'); +var ___errno_location = createExportWrapper('__errno_location'); +var _fflush = Module['_fflush'] = createExportWrapper('fflush'); +var _emscripten_stack_init = () => (_emscripten_stack_init = wasmExports['emscripten_stack_init'])(); +var _emscripten_stack_get_free = () => (_emscripten_stack_get_free = wasmExports['emscripten_stack_get_free'])(); +var _emscripten_stack_get_base = () => (_emscripten_stack_get_base = wasmExports['emscripten_stack_get_base'])(); +var _emscripten_stack_get_end = () => (_emscripten_stack_get_end = wasmExports['emscripten_stack_get_end'])(); +var stackSave = createExportWrapper('stackSave'); +var stackRestore = createExportWrapper('stackRestore'); +var stackAlloc = createExportWrapper('stackAlloc'); +var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'])(); +var ___cxa_demangle = createExportWrapper('__cxa_demangle'); +var ___cxa_is_pointer_type = createExportWrapper('__cxa_is_pointer_type'); +var dynCall_jiji = Module['dynCall_jiji'] = createExportWrapper('dynCall_jiji'); // include: postamble.js @@ -4185,6 +4876,291 @@ var dynCall_jiji = Module['dynCall_jiji'] = (a0, a1, a2, a3, a4) => (dynCall_jij Module['UTF8ToString'] = UTF8ToString; Module['AsciiToString'] = AsciiToString; Module['allocateUTF8'] = allocateUTF8; +var missingLibrarySymbols = [ + 'writeI53ToI64', + 'writeI53ToI64Clamped', + 'writeI53ToI64Signaling', + 'writeI53ToU64Clamped', + 'writeI53ToU64Signaling', + 'readI53FromI64', + 'readI53FromU64', + 'convertI32PairToI53', + 'convertU32PairToI53', + 'isLeapYear', + 'ydayFromDate', + 'arraySum', + 'addDays', + 'inetPton4', + 'inetNtop4', + 'inetPton6', + 'inetNtop6', + 'readSockaddr', + 'writeSockaddr', + 'getHostByName', + 'getCallstack', + 'emscriptenLog', + 'convertPCtoSourceLocation', + 'runMainThreadEmAsm', + 'jstoi_q', + 'jstoi_s', + 'getExecutableName', + 'listenOnce', + 'autoResumeAudioContext', + 'dynCallLegacy', + 'getDynCaller', + 'dynCall', + 'handleException', + 'runtimeKeepalivePush', + 'runtimeKeepalivePop', + 'callUserCallback', + 'maybeExit', + 'asmjsMangle', + 'handleAllocatorInit', + 'HandleAllocator', + 'getNativeTypeSize', + 'STACK_SIZE', + 'STACK_ALIGN', + 'POINTER_SIZE', + 'ASSERTIONS', + 'getCFunc', + 'ccall', + 'cwrap', + 'uleb128Encode', + 'sigToWasmTypes', + 'generateFuncType', + 'convertJsFunctionToWasm', + 'getEmptyTableSlot', + 'updateTableMap', + 'getFunctionAddress', + 'addFunction', + 'removeFunction', + 'reallyNegative', + 'unSign', + 'strLen', + 'reSign', + 'formatString', + 'intArrayToString', + 'stringToAscii', + 'UTF16ToString', + 'stringToUTF16', + 'lengthBytesUTF16', + 'UTF32ToString', + 'stringToUTF32', + 'lengthBytesUTF32', + 'writeArrayToMemory', + 'registerKeyEventCallback', + 'findEventTarget', + 'findCanvasEventTarget', + 'getBoundingClientRect', + 'fillMouseEventData', + 'registerMouseEventCallback', + 'registerWheelEventCallback', + 'registerUiEventCallback', + 'registerFocusEventCallback', + 'fillDeviceOrientationEventData', + 'registerDeviceOrientationEventCallback', + 'fillDeviceMotionEventData', + 'registerDeviceMotionEventCallback', + 'screenOrientation', + 'fillOrientationChangeEventData', + 'registerOrientationChangeEventCallback', + 'fillFullscreenChangeEventData', + 'registerFullscreenChangeEventCallback', + 'JSEvents_requestFullscreen', + 'JSEvents_resizeCanvasForFullscreen', + 'registerRestoreOldStyle', + 'hideEverythingExceptGivenElement', + 'restoreHiddenElements', + 'setLetterbox', + 'softFullscreenResizeWebGLRenderTarget', + 'doRequestFullscreen', + 'fillPointerlockChangeEventData', + 'registerPointerlockChangeEventCallback', + 'registerPointerlockErrorEventCallback', + 'requestPointerLock', + 'fillVisibilityChangeEventData', + 'registerVisibilityChangeEventCallback', + 'registerTouchEventCallback', + 'fillGamepadEventData', + 'registerGamepadEventCallback', + 'registerBeforeUnloadEventCallback', + 'fillBatteryEventData', + 'battery', + 'registerBatteryEventCallback', + 'setCanvasElementSize', + 'getCanvasElementSize', + 'getEnvStrings', + 'checkWasiClock', + 'wasiRightsToMuslOFlags', + 'wasiOFlagsToMuslOFlags', + 'createDyncallWrapper', + 'safeSetTimeout', + 'setImmediateWrapped', + 'clearImmediateWrapped', + 'polyfillSetImmediate', + 'getPromise', + 'makePromise', + 'idsToPromises', + 'makePromiseCallback', + 'findMatchingCatch', + 'setMainLoop', + 'getSocketFromFD', + 'getSocketAddress', + 'FS_unlink', + 'FS_mkdirTree', + '_setNetworkCallback', + 'heapObjectForWebGLType', + 'heapAccessShiftForWebGLHeap', + 'webgl_enable_ANGLE_instanced_arrays', + 'webgl_enable_OES_vertex_array_object', + 'webgl_enable_WEBGL_draw_buffers', + 'webgl_enable_WEBGL_multi_draw', + 'emscriptenWebGLGet', + 'computeUnpackAlignedImageSize', + 'colorChannelsInGlTextureFormat', + 'emscriptenWebGLGetTexPixelData', + '__glGenObject', + 'emscriptenWebGLGetUniform', + 'webglGetUniformLocation', + 'webglPrepareUniformLocationsBeforeFirstUse', + 'webglGetLeftBracePos', + 'emscriptenWebGLGetVertexAttrib', + '__glGetActiveAttribOrUniform', + 'writeGLArray', + 'registerWebGlEventCallback', + 'runAndAbortIfError', + 'SDL_unicode', + 'SDL_ttfContext', + 'SDL_audio', + 'ALLOC_NORMAL', + 'ALLOC_STACK', + 'allocate', + 'writeStringToMemory', + 'writeAsciiToMemory', +]; +missingLibrarySymbols.forEach(missingLibrarySymbol) + +var unexportedSymbols = [ + 'run', + 'addOnPreRun', + 'addOnInit', + 'addOnPreMain', + 'addOnExit', + 'addOnPostRun', + 'addRunDependency', + 'removeRunDependency', + 'FS_createFolder', + 'FS_createPath', + 'FS_createLazyFile', + 'FS_createLink', + 'FS_createDevice', + 'FS_readFile', + 'out', + 'err', + 'callMain', + 'abort', + 'wasmMemory', + 'wasmExports', + 'stackAlloc', + 'stackSave', + 'stackRestore', + 'getTempRet0', + 'setTempRet0', + 'writeStackCookie', + 'checkStackCookie', + 'convertI32PairToI53Checked', + 'ptrToString', + 'zeroMemory', + 'exitJS', + 'getHeapMax', + 'growMemory', + 'ENV', + 'MONTH_DAYS_REGULAR', + 'MONTH_DAYS_LEAP', + 'MONTH_DAYS_REGULAR_CUMULATIVE', + 'MONTH_DAYS_LEAP_CUMULATIVE', + 'ERRNO_CODES', + 'ERRNO_MESSAGES', + 'setErrNo', + 'DNS', + 'Protocols', + 'Sockets', + 'initRandomFill', + 'randomFill', + 'timers', + 'warnOnce', + 'UNWIND_CACHE', + 'readEmAsmArgsArray', + 'readEmAsmArgs', + 'runEmAsmFunction', + 'keepRuntimeAlive', + 'asyncLoad', + 'alignMemory', + 'mmapAlloc', + 'wasmTable', + 'noExitRuntime', + 'freeTableIndexes', + 'functionsInTableMap', + 'setValue', + 'getValue', + 'PATH', + 'PATH_FS', + 'UTF8Decoder', + 'UTF8ArrayToString', + 'stringToUTF8Array', + 'stringToUTF8', + 'lengthBytesUTF8', + 'intArrayFromString', + 'UTF16Decoder', + 'stringToNewUTF8', + 'stringToUTF8OnStack', + 'JSEvents', + 'specialHTMLTargets', + 'currentFullscreenStrategy', + 'restoreOldWindowedStyle', + 'demangle', + 'demangleAll', + 'jsStackTrace', + 'stackTrace', + 'ExitStatus', + 'doReadv', + 'doWritev', + 'promiseMap', + 'uncaughtExceptionCount', + 'exceptionLast', + 'exceptionCaught', + 'ExceptionInfo', + 'Browser', + 'wget', + 'SYSCALLS', + 'preloadPlugins', + 'FS_createPreloadedFile', + 'FS_modeStringToFlags', + 'FS_getMode', + 'FS_stdin_getChar_buffer', + 'FS_stdin_getChar', + 'FS', + 'FS_createDataFile', + 'MEMFS', + 'TTY', + 'PIPEFS', + 'SOCKFS', + 'tempFixedLengthArray', + 'miniTempWebGLFloatBuffers', + 'miniTempWebGLIntBuffers', + 'GL', + 'emscripten_webgl_power_preferences', + 'AL', + 'GLUT', + 'EGL', + 'GLEW', + 'IDBStore', + 'SDL', + 'SDL_gfx', + 'allocateUTF8OnStack', +]; +unexportedSymbols.forEach(unexportedRuntimeSymbol); + var calledRun; @@ -4195,12 +5171,23 @@ dependenciesFulfilled = function runCaller() { if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled }; +function stackCheckInit() { + // 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. + _emscripten_stack_init(); + // TODO(sbc): Move writeStackCookie to native to to avoid this. + writeStackCookie(); +} + function run() { if (runDependencies > 0) { return; } + stackCheckInit(); + preRun(); // a preRun added a dependency, run will be called later @@ -4221,6 +5208,8 @@ function run() { if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized'](); + assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); + postRun(); } @@ -4236,6 +5225,46 @@ function run() { { doRun(); } + checkStackCookie(); +} + +function checkUnflushedContent() { + // 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) + var oldOut = out; + var oldErr = err; + var has = 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) { + var info = FS.analyzePath('/dev/' + name); + if (!info) return; + var stream = info.object; + var rdev = stream.rdev; + var tty = 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 Emscripten FAQ), or make sure to emit a newline when you printf etc.'); + } } if (Module['preInit']) { diff --git a/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.wasm b/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.wasm index 007b6fa6..38d6b21b 100644 Binary files a/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.wasm and b/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.wasm differ