diff --git a/package-lock.json b/package-lock.json index df9810426b..31d89b3264 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,6 +42,7 @@ "express": "4.21.2", "fast-xml-parser": "5.3.0", "file-saver": "^2.0.5", + "fs-ext-extra-prebuilt": "2.2.6", "fs-extra": "11.1.1", "ini": "4.1.2", "jsonc-parser": "3.3.1", @@ -151,7 +152,7 @@ "npm": ">=10.1.0" }, "optionalDependencies": { - "fs-ext": "2.1.1" + "fs-ext-extra-prebuilt": "2.2.6" } }, "node_modules/@ai-sdk/gateway": { @@ -26936,14 +26937,15 @@ "dev": true, "license": "MIT" }, - "node_modules/fs-ext": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fs-ext/-/fs-ext-2.1.1.tgz", - "integrity": "sha512-/TrISPOFhCkbgIRWK9lzscRzwPCu0PqtCcvMc9jsHKBgZGoqA0VzhspVht5Zu8lxaXjIYIBWILHpRotYkCCcQA==", + "node_modules/fs-ext-extra-prebuilt": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/fs-ext-extra-prebuilt/-/fs-ext-extra-prebuilt-2.2.6.tgz", + "integrity": "sha512-4oCLtlOyuXMdlrhOZf6B3HKoUbz773p2C2Mi++erFpFYDAA2Gv5/P9s8YC/ZGSexYEZmMI6jyVCy8YlmQ3Mawg==", "hasInstallScript": true, + "license": "MIT", "optional": true, "dependencies": { - "nan": "^2.21.0" + "nan": "^2.24.0" }, "engines": { "node": ">= 8.0.0" @@ -37285,9 +37287,9 @@ } }, "node_modules/nan": { - "version": "2.23.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.23.1.tgz", - "integrity": "sha512-r7bBUGKzlqk8oPBDYxt6Z0aEdF1G1rwlMcLk8LCOMbOzf0mG+JUfUzG4fIMWwHWP0iyaLWEQZJmtB7nOHEm/qw==", + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.24.0.tgz", + "integrity": "sha512-Vpf9qnVW1RaDkoNKFUvfxqAbtI8ncb8OJlqZ9wwpXzWPEsvsB1nvdUi6oYrHIkQ1Y/tMDnr1h4nczS0VB9Xykg==", "license": "MIT", "optional": true }, diff --git a/package.json b/package.json index 5e05410341..09d634a6d1 100644 --- a/package.json +++ b/package.json @@ -78,8 +78,8 @@ "@codemirror/lang-javascript": "6.2.4", "@codemirror/lang-json": "6.0.2", "@codemirror/lang-markdown": "6.3.4", - "@codemirror/lang-sql": "6.8.0", "@codemirror/lang-php": "6.0.2", + "@codemirror/lang-sql": "6.8.0", "@codemirror/language": "6.11.3", "@codemirror/search": "6.5.11", "@codemirror/state": "6.5.2", @@ -223,6 +223,6 @@ "npm": ">=10.1.0" }, "optionalDependencies": { - "fs-ext": "2.1.1" + "fs-ext-extra-prebuilt": "2.2.6" } } diff --git a/packages/php-wasm/cli/src/main.ts b/packages/php-wasm/cli/src/main.ts index 95b0006c90..c1979303e9 100644 --- a/packages/php-wasm/cli/src/main.ts +++ b/packages/php-wasm/cli/src/main.ts @@ -11,11 +11,7 @@ import os from 'os'; import { rootCertificates } from 'tls'; /* eslint-disable no-console */ import { addXdebugIDEConfig, clearXdebugIDEConfig } from '@php-wasm/cli-util'; -import { - FileLockManagerForNode, - loadNodeRuntime, - useHostFilesystem, -} from '@php-wasm/node'; +import { loadNodeRuntime, useHostFilesystem } from '@php-wasm/node'; import type { SupportedPHPVersion } from '@php-wasm/universal'; import { PHP } from '@php-wasm/universal'; import { startBridge } from '@php-wasm/xdebug-bridge'; @@ -119,7 +115,6 @@ ${process.argv[0]} ${process.execArgv.join(' ')} ${process.argv[1]} const sysTempDir = mkdtempSync(path.join(os.tmpdir(), 'php-wasm-sys-tmp')); const php = new PHP( await loadNodeRuntime(phpVersion, { - fileLockManager: new FileLockManagerForNode(), emscriptenOptions: { processId: 1, ENV: { diff --git a/packages/php-wasm/node/asyncify/php_7_2.js b/packages/php-wasm/node/asyncify/php_7_2.js index 6559821907..30fe5474fa 100644 --- a/packages/php-wasm/node/asyncify/php_7_2.js +++ b/packages/php-wasm/node/asyncify/php_7_2.js @@ -5118,10 +5118,8 @@ export function init(RuntimeName, PHPLoader) { ); var ___call_sighandler = (fp, sig) => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - sig + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ sig ); ___call_sighandler.sig = 'vpi'; @@ -8384,11 +8382,8 @@ export function init(RuntimeName, PHPLoader) { dlSetError(`'Could not load dynamic lib: ${filename}\n${e}`); runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -8396,11 +8391,8 @@ export function init(RuntimeName, PHPLoader) { function successCallback() { runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -17965,11 +17957,8 @@ export function init(RuntimeName, PHPLoader) { var trace = getCallstack(); var parts = trace.split('\n'); for (var i = 0; i < parts.length; i++) { - var ret = (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0, + var ret = ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0, arg ); if (ret !== 0) return; @@ -18513,12 +18502,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(e.locale || '', keyEventData + 128, 32); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, keyEventData, userData ) @@ -18636,12 +18621,8 @@ export function init(RuntimeName, PHPLoader) { fillMouseEventData(JSEvents.mouseEvent, e, target); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.mouseEvent, userData ) @@ -18855,12 +18836,8 @@ export function init(RuntimeName, PHPLoader) { HEAPF64[(wheelEvent + 80) >> 3] = e['deltaZ']; HEAP32[(wheelEvent + 88) >> 2] = e['deltaMode']; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, wheelEvent, userData ) @@ -18941,12 +18918,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(uiEvent + 28) >> 2] = pageXOffset | 0; // scroll offsets are float HEAP32[(uiEvent + 32) >> 2] = pageYOffset | 0; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, uiEvent, userData ) @@ -19020,12 +18993,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(id, focusEvent + 128, 128); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, focusEvent, userData ) @@ -19141,12 +19110,8 @@ export function init(RuntimeName, PHPLoader) { ); // TODO: Thread-safety with respect to emscripten_get_deviceorientation_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceOrientationEvent, userData ) @@ -19230,12 +19195,8 @@ export function init(RuntimeName, PHPLoader) { fillDeviceMotionEventData(JSEvents.deviceMotionEvent, e, target); // TODO: Thread-safety with respect to emscripten_get_devicemotion_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceMotionEvent, userData ) @@ -19342,12 +19303,8 @@ export function init(RuntimeName, PHPLoader) { fillOrientationChangeEventData(orientationChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, orientationChangeEvent, userData ) @@ -19476,12 +19433,8 @@ export function init(RuntimeName, PHPLoader) { fillFullscreenChangeEventData(fullscreenChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, fullscreenChangeEvent, userData ) @@ -19626,12 +19579,8 @@ export function init(RuntimeName, PHPLoader) { ); if (currentFullscreenStrategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19732,12 +19681,8 @@ export function init(RuntimeName, PHPLoader) { currentFullscreenStrategy = strategy; if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19837,12 +19782,8 @@ export function init(RuntimeName, PHPLoader) { !inCenteredWithoutScalingFullscreenMode && currentFullscreenStrategy.canvasResizedCallback ) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19941,12 +19882,8 @@ export function init(RuntimeName, PHPLoader) { softFullscreenResizeWebGLRenderTarget ); if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19959,12 +19896,8 @@ export function init(RuntimeName, PHPLoader) { // Inform the caller that the canvas size has changed. if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -20026,12 +19959,8 @@ export function init(RuntimeName, PHPLoader) { fillPointerlockChangeEventData(pointerlockChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, pointerlockChangeEvent, userData ) @@ -20085,12 +20014,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var pointerlockErrorEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -20244,12 +20169,8 @@ export function init(RuntimeName, PHPLoader) { fillVisibilityChangeEventData(visibilityChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, visibilityChangeEvent, userData ) @@ -20369,12 +20290,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(touchEvent + 8) >> 2] = numTouches; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, touchEvent, userData ) @@ -20512,12 +20429,8 @@ export function init(RuntimeName, PHPLoader) { fillGamepadEventData(gamepadEvent, e['gamepad']); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, gamepadEvent, userData ) @@ -20619,12 +20532,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var beforeUnloadEventHandlerFunc = (e = event) => { // Note: This is always called on the main browser thread, since it needs synchronously return a value! - var confirmationMessage = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + var confirmationMessage = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ); @@ -20695,12 +20604,8 @@ export function init(RuntimeName, PHPLoader) { fillBatteryEventData(batteryEvent, battery); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, batteryEvent, userData ) @@ -20802,11 +20707,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame((timeStamp) => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ); @@ -20818,11 +20720,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame_loop = (cb, userData) => { function tick(timeStamp) { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ) { @@ -21079,10 +20978,8 @@ export function init(RuntimeName, PHPLoader) { return emSetImmediate(() => { runtimeKeepalivePop(); callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }); @@ -21099,10 +20996,8 @@ export function init(RuntimeName, PHPLoader) { function tick() { callUserCallback(() => { if ( - (( - a1 - ) => {}) /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ) { emSetImmediate(tick); @@ -21119,10 +21014,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_timeout = (cb, msecs, userData) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ), msecs ); @@ -21138,11 +21031,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - t, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ t, userData ) ) { @@ -21166,10 +21056,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePush(); return setInterval(() => { callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }, msecs); @@ -21184,10 +21072,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_async_call = (func, arg, millis) => { var wrapper = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); if ( @@ -21220,7 +21106,7 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_main_loop = (func, fps, simulateInfiniteLoop) => { var iterFunc = - () => {} /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */; + () => {}; /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ setMainLoop(iterFunc, fps, simulateInfiniteLoop); }; _emscripten_set_main_loop.sig = 'vpii'; @@ -21232,10 +21118,8 @@ export function init(RuntimeName, PHPLoader) { simulateInfiniteLoop ) => { var iterFunc = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); setMainLoop(iterFunc, fps, simulateInfiniteLoop, arg); }; @@ -21256,10 +21140,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21272,10 +21154,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_uncounted_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21309,12 +21189,8 @@ export function init(RuntimeName, PHPLoader) { var resultPtr = stackAlloc(POINTER_SIZE); HEAPU32[resultPtr >> 2] = 0; try { - var result = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - resultPtr, + var result = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ resultPtr, userData, value ); @@ -22151,19 +22027,15 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, true // don'tCreateFile - it's already there @@ -22197,21 +22069,16 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, cname ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, true // don'tCreateFile - it's already there @@ -22479,10 +22346,10 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => withStackSave(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stringToUTF8OnStack(_file) + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stringToUTF8OnStack( + _file + ) ) ) ); @@ -22526,12 +22393,8 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata, buffer, byteArray.length ); @@ -22541,10 +22404,8 @@ export function init(RuntimeName, PHPLoader) { if (onerror) { runtimeKeepalivePop(); callUserCallback(() => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata ); }); } @@ -22600,12 +22461,8 @@ export function init(RuntimeName, PHPLoader) { ); if (onload) { var sp = stackSave(); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, stringToUTF8OnStack(_file) ); @@ -22613,12 +22470,8 @@ export function init(RuntimeName, PHPLoader) { } } else { if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22631,12 +22484,8 @@ export function init(RuntimeName, PHPLoader) { http.onerror = (e) => { runtimeKeepalivePop(); if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22651,12 +22500,8 @@ export function init(RuntimeName, PHPLoader) { ) { var percentComplete = (e.loaded / e.total) * 100; if (onprogress) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, percentComplete ); @@ -22713,13 +22558,8 @@ export function init(RuntimeName, PHPLoader) { if (http.statusText) { statusText = stringToUTF8OnStack(http.statusText); } - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status, statusText @@ -22740,13 +22580,8 @@ export function init(RuntimeName, PHPLoader) { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); if (onload) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, buffer, byteArray.length @@ -22767,13 +22602,8 @@ export function init(RuntimeName, PHPLoader) { // PROGRESS http.onprogress = (e) => { if (onprogress) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, e.loaded, e.lengthComputable || e.lengthComputable === undefined @@ -23104,24 +22934,16 @@ export function init(RuntimeName, PHPLoader) { if (event === 'error') { withStackSave(() => { var msg = stringToUTF8OnStack(data[2]); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data[0], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data[0], data[1], msg, userData ); }); } else { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data, userData ); } @@ -24074,12 +23896,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var webGlEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -24298,21 +24116,15 @@ export function init(RuntimeName, PHPLoader) { ) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } else if (GLUT.buttons != 0 && GLUT.motionFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } @@ -24473,12 +24285,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24488,12 +24296,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24508,12 +24312,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24523,12 +24323,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24592,13 +24388,10 @@ export function init(RuntimeName, PHPLoader) { } catch (e) {} event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24613,13 +24406,10 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 1 /*GLUT_UP*/, Browser.mouseX, Browser.mouseY @@ -24648,13 +24438,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - button, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ button, 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24692,11 +24477,8 @@ export function init(RuntimeName, PHPLoader) { /* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */ if (GLUT.reshapeFunc) { // out("GLUT.reshapeFunc (from FS): " + width + ", " + height); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24752,11 +24534,8 @@ export function init(RuntimeName, PHPLoader) { // Resize callback stage 2: updateResizeListeners notifies reshapeFunc Browser.resizeListeners.push((width, height) => { if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24871,10 +24650,8 @@ export function init(RuntimeName, PHPLoader) { var _glutTimerFunc = (msec, func, value) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - value + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ value ), msec ); @@ -25034,11 +24811,8 @@ export function init(RuntimeName, PHPLoader) { Browser.setCanvasSize(width, height, true); // N.B. GLUT.reshapeFunc is also registered as a canvas resize callback. // Just call it once here. if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -26092,21 +25866,15 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, buffer, byteArray.length ); @@ -26138,18 +25906,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onstore) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); } @@ -26164,18 +25928,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (ondelete) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26192,19 +25952,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (oncheck) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, exists ); }); @@ -26220,18 +25975,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onclear) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26388,11 +26139,8 @@ export function init(RuntimeName, PHPLoader) { safeSetTimeout(() => { var stackBegin = Asyncify.currData + 12; var stackEnd = HEAPU32[Asyncify.currData >> 2]; - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stackBegin, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stackBegin, stackEnd ); wakeUp(); @@ -26441,10 +26189,8 @@ export function init(RuntimeName, PHPLoader) { HEAPU32[(newFiber + 12) >> 2] = 0; var userData = HEAPU32[(newFiber + 16) >> 2]; - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ); } else { var asyncifyData = newFiber + 20; @@ -27455,11 +27201,8 @@ export function init(RuntimeName, PHPLoader) { if (!SDL.eventHandler) return; while (SDL.pollEvent(SDL.eventHandlerTemp)) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.eventHandlerContext, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL.eventHandlerContext, SDL.eventHandlerTemp ); } @@ -29083,12 +28826,9 @@ export function init(RuntimeName, PHPLoader) { return; // Ask SDL audio data from the user code. - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.audio.userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL + .audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize ); @@ -29546,10 +29286,8 @@ export function init(RuntimeName, PHPLoader) { info.audio = null; } if (SDL.channelFinished) { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); } } @@ -29617,10 +29355,8 @@ export function init(RuntimeName, PHPLoader) { channelInfo.audio = null; } if (SDL.channelFinished) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); }; if (channelInfo.audio) { @@ -30355,11 +30091,8 @@ export function init(RuntimeName, PHPLoader) { var _SDL_AddTimer = (interval, callback, param) => safeSetTimeout( () => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - interval, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ interval, param ), interval @@ -30744,12 +30477,8 @@ export function init(RuntimeName, PHPLoader) { socket.onopen = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30771,12 +30500,8 @@ export function init(RuntimeName, PHPLoader) { socket.onerror = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30801,12 +30526,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAP8[eventPtr + 4] = e.wasClean), (HEAP16[(eventPtr + 6) >> 1] = e.code), stringToUTF8(e.reason, eventPtr + 8, 512)); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30840,12 +30561,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAPU32[(eventPtr + 4) >> 2] = buf), (HEAP32[(eventPtr + 8) >> 2] = len), (HEAP8[eventPtr + 12] = isText), - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData )); diff --git a/packages/php-wasm/node/asyncify/php_7_3.js b/packages/php-wasm/node/asyncify/php_7_3.js index 29d91c42f0..157fb969b5 100644 --- a/packages/php-wasm/node/asyncify/php_7_3.js +++ b/packages/php-wasm/node/asyncify/php_7_3.js @@ -5118,10 +5118,8 @@ export function init(RuntimeName, PHPLoader) { ); var ___call_sighandler = (fp, sig) => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - sig + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ sig ); ___call_sighandler.sig = 'vpi'; @@ -8384,11 +8382,8 @@ export function init(RuntimeName, PHPLoader) { dlSetError(`'Could not load dynamic lib: ${filename}\n${e}`); runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -8396,11 +8391,8 @@ export function init(RuntimeName, PHPLoader) { function successCallback() { runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -17965,11 +17957,8 @@ export function init(RuntimeName, PHPLoader) { var trace = getCallstack(); var parts = trace.split('\n'); for (var i = 0; i < parts.length; i++) { - var ret = (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0, + var ret = ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0, arg ); if (ret !== 0) return; @@ -18513,12 +18502,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(e.locale || '', keyEventData + 128, 32); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, keyEventData, userData ) @@ -18636,12 +18621,8 @@ export function init(RuntimeName, PHPLoader) { fillMouseEventData(JSEvents.mouseEvent, e, target); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.mouseEvent, userData ) @@ -18855,12 +18836,8 @@ export function init(RuntimeName, PHPLoader) { HEAPF64[(wheelEvent + 80) >> 3] = e['deltaZ']; HEAP32[(wheelEvent + 88) >> 2] = e['deltaMode']; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, wheelEvent, userData ) @@ -18941,12 +18918,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(uiEvent + 28) >> 2] = pageXOffset | 0; // scroll offsets are float HEAP32[(uiEvent + 32) >> 2] = pageYOffset | 0; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, uiEvent, userData ) @@ -19020,12 +18993,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(id, focusEvent + 128, 128); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, focusEvent, userData ) @@ -19141,12 +19110,8 @@ export function init(RuntimeName, PHPLoader) { ); // TODO: Thread-safety with respect to emscripten_get_deviceorientation_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceOrientationEvent, userData ) @@ -19230,12 +19195,8 @@ export function init(RuntimeName, PHPLoader) { fillDeviceMotionEventData(JSEvents.deviceMotionEvent, e, target); // TODO: Thread-safety with respect to emscripten_get_devicemotion_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceMotionEvent, userData ) @@ -19342,12 +19303,8 @@ export function init(RuntimeName, PHPLoader) { fillOrientationChangeEventData(orientationChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, orientationChangeEvent, userData ) @@ -19476,12 +19433,8 @@ export function init(RuntimeName, PHPLoader) { fillFullscreenChangeEventData(fullscreenChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, fullscreenChangeEvent, userData ) @@ -19626,12 +19579,8 @@ export function init(RuntimeName, PHPLoader) { ); if (currentFullscreenStrategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19732,12 +19681,8 @@ export function init(RuntimeName, PHPLoader) { currentFullscreenStrategy = strategy; if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19837,12 +19782,8 @@ export function init(RuntimeName, PHPLoader) { !inCenteredWithoutScalingFullscreenMode && currentFullscreenStrategy.canvasResizedCallback ) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19941,12 +19882,8 @@ export function init(RuntimeName, PHPLoader) { softFullscreenResizeWebGLRenderTarget ); if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19959,12 +19896,8 @@ export function init(RuntimeName, PHPLoader) { // Inform the caller that the canvas size has changed. if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -20026,12 +19959,8 @@ export function init(RuntimeName, PHPLoader) { fillPointerlockChangeEventData(pointerlockChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, pointerlockChangeEvent, userData ) @@ -20085,12 +20014,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var pointerlockErrorEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -20244,12 +20169,8 @@ export function init(RuntimeName, PHPLoader) { fillVisibilityChangeEventData(visibilityChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, visibilityChangeEvent, userData ) @@ -20369,12 +20290,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(touchEvent + 8) >> 2] = numTouches; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, touchEvent, userData ) @@ -20512,12 +20429,8 @@ export function init(RuntimeName, PHPLoader) { fillGamepadEventData(gamepadEvent, e['gamepad']); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, gamepadEvent, userData ) @@ -20619,12 +20532,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var beforeUnloadEventHandlerFunc = (e = event) => { // Note: This is always called on the main browser thread, since it needs synchronously return a value! - var confirmationMessage = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + var confirmationMessage = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ); @@ -20695,12 +20604,8 @@ export function init(RuntimeName, PHPLoader) { fillBatteryEventData(batteryEvent, battery); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, batteryEvent, userData ) @@ -20802,11 +20707,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame((timeStamp) => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ); @@ -20818,11 +20720,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame_loop = (cb, userData) => { function tick(timeStamp) { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ) { @@ -21079,10 +20978,8 @@ export function init(RuntimeName, PHPLoader) { return emSetImmediate(() => { runtimeKeepalivePop(); callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }); @@ -21099,10 +20996,8 @@ export function init(RuntimeName, PHPLoader) { function tick() { callUserCallback(() => { if ( - (( - a1 - ) => {}) /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ) { emSetImmediate(tick); @@ -21119,10 +21014,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_timeout = (cb, msecs, userData) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ), msecs ); @@ -21138,11 +21031,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - t, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ t, userData ) ) { @@ -21166,10 +21056,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePush(); return setInterval(() => { callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }, msecs); @@ -21184,10 +21072,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_async_call = (func, arg, millis) => { var wrapper = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); if ( @@ -21220,7 +21106,7 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_main_loop = (func, fps, simulateInfiniteLoop) => { var iterFunc = - () => {} /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */; + () => {}; /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ setMainLoop(iterFunc, fps, simulateInfiniteLoop); }; _emscripten_set_main_loop.sig = 'vpii'; @@ -21232,10 +21118,8 @@ export function init(RuntimeName, PHPLoader) { simulateInfiniteLoop ) => { var iterFunc = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); setMainLoop(iterFunc, fps, simulateInfiniteLoop, arg); }; @@ -21256,10 +21140,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21272,10 +21154,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_uncounted_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21309,12 +21189,8 @@ export function init(RuntimeName, PHPLoader) { var resultPtr = stackAlloc(POINTER_SIZE); HEAPU32[resultPtr >> 2] = 0; try { - var result = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - resultPtr, + var result = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ resultPtr, userData, value ); @@ -22151,19 +22027,15 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, true // don'tCreateFile - it's already there @@ -22197,21 +22069,16 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, cname ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, true // don'tCreateFile - it's already there @@ -22479,10 +22346,10 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => withStackSave(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stringToUTF8OnStack(_file) + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stringToUTF8OnStack( + _file + ) ) ) ); @@ -22526,12 +22393,8 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata, buffer, byteArray.length ); @@ -22541,10 +22404,8 @@ export function init(RuntimeName, PHPLoader) { if (onerror) { runtimeKeepalivePop(); callUserCallback(() => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata ); }); } @@ -22600,12 +22461,8 @@ export function init(RuntimeName, PHPLoader) { ); if (onload) { var sp = stackSave(); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, stringToUTF8OnStack(_file) ); @@ -22613,12 +22470,8 @@ export function init(RuntimeName, PHPLoader) { } } else { if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22631,12 +22484,8 @@ export function init(RuntimeName, PHPLoader) { http.onerror = (e) => { runtimeKeepalivePop(); if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22651,12 +22500,8 @@ export function init(RuntimeName, PHPLoader) { ) { var percentComplete = (e.loaded / e.total) * 100; if (onprogress) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, percentComplete ); @@ -22713,13 +22558,8 @@ export function init(RuntimeName, PHPLoader) { if (http.statusText) { statusText = stringToUTF8OnStack(http.statusText); } - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status, statusText @@ -22740,13 +22580,8 @@ export function init(RuntimeName, PHPLoader) { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); if (onload) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, buffer, byteArray.length @@ -22767,13 +22602,8 @@ export function init(RuntimeName, PHPLoader) { // PROGRESS http.onprogress = (e) => { if (onprogress) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, e.loaded, e.lengthComputable || e.lengthComputable === undefined @@ -23104,24 +22934,16 @@ export function init(RuntimeName, PHPLoader) { if (event === 'error') { withStackSave(() => { var msg = stringToUTF8OnStack(data[2]); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data[0], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data[0], data[1], msg, userData ); }); } else { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data, userData ); } @@ -24074,12 +23896,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var webGlEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -24298,21 +24116,15 @@ export function init(RuntimeName, PHPLoader) { ) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } else if (GLUT.buttons != 0 && GLUT.motionFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } @@ -24473,12 +24285,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24488,12 +24296,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24508,12 +24312,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24523,12 +24323,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24592,13 +24388,10 @@ export function init(RuntimeName, PHPLoader) { } catch (e) {} event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24613,13 +24406,10 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 1 /*GLUT_UP*/, Browser.mouseX, Browser.mouseY @@ -24648,13 +24438,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - button, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ button, 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24692,11 +24477,8 @@ export function init(RuntimeName, PHPLoader) { /* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */ if (GLUT.reshapeFunc) { // out("GLUT.reshapeFunc (from FS): " + width + ", " + height); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24752,11 +24534,8 @@ export function init(RuntimeName, PHPLoader) { // Resize callback stage 2: updateResizeListeners notifies reshapeFunc Browser.resizeListeners.push((width, height) => { if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24871,10 +24650,8 @@ export function init(RuntimeName, PHPLoader) { var _glutTimerFunc = (msec, func, value) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - value + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ value ), msec ); @@ -25034,11 +24811,8 @@ export function init(RuntimeName, PHPLoader) { Browser.setCanvasSize(width, height, true); // N.B. GLUT.reshapeFunc is also registered as a canvas resize callback. // Just call it once here. if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -26092,21 +25866,15 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, buffer, byteArray.length ); @@ -26138,18 +25906,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onstore) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); } @@ -26164,18 +25928,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (ondelete) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26192,19 +25952,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (oncheck) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, exists ); }); @@ -26220,18 +25975,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onclear) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26388,11 +26139,8 @@ export function init(RuntimeName, PHPLoader) { safeSetTimeout(() => { var stackBegin = Asyncify.currData + 12; var stackEnd = HEAPU32[Asyncify.currData >> 2]; - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stackBegin, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stackBegin, stackEnd ); wakeUp(); @@ -26441,10 +26189,8 @@ export function init(RuntimeName, PHPLoader) { HEAPU32[(newFiber + 12) >> 2] = 0; var userData = HEAPU32[(newFiber + 16) >> 2]; - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ); } else { var asyncifyData = newFiber + 20; @@ -27455,11 +27201,8 @@ export function init(RuntimeName, PHPLoader) { if (!SDL.eventHandler) return; while (SDL.pollEvent(SDL.eventHandlerTemp)) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.eventHandlerContext, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL.eventHandlerContext, SDL.eventHandlerTemp ); } @@ -29083,12 +28826,9 @@ export function init(RuntimeName, PHPLoader) { return; // Ask SDL audio data from the user code. - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.audio.userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL + .audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize ); @@ -29546,10 +29286,8 @@ export function init(RuntimeName, PHPLoader) { info.audio = null; } if (SDL.channelFinished) { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); } } @@ -29617,10 +29355,8 @@ export function init(RuntimeName, PHPLoader) { channelInfo.audio = null; } if (SDL.channelFinished) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); }; if (channelInfo.audio) { @@ -30355,11 +30091,8 @@ export function init(RuntimeName, PHPLoader) { var _SDL_AddTimer = (interval, callback, param) => safeSetTimeout( () => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - interval, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ interval, param ), interval @@ -30744,12 +30477,8 @@ export function init(RuntimeName, PHPLoader) { socket.onopen = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30771,12 +30500,8 @@ export function init(RuntimeName, PHPLoader) { socket.onerror = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30801,12 +30526,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAP8[eventPtr + 4] = e.wasClean), (HEAP16[(eventPtr + 6) >> 1] = e.code), stringToUTF8(e.reason, eventPtr + 8, 512)); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30840,12 +30561,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAPU32[(eventPtr + 4) >> 2] = buf), (HEAP32[(eventPtr + 8) >> 2] = len), (HEAP8[eventPtr + 12] = isText), - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData )); diff --git a/packages/php-wasm/node/asyncify/php_7_4.js b/packages/php-wasm/node/asyncify/php_7_4.js index 612f2385e8..c7ef120980 100644 --- a/packages/php-wasm/node/asyncify/php_7_4.js +++ b/packages/php-wasm/node/asyncify/php_7_4.js @@ -5118,10 +5118,8 @@ export function init(RuntimeName, PHPLoader) { ); var ___call_sighandler = (fp, sig) => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - sig + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ sig ); ___call_sighandler.sig = 'vpi'; @@ -8384,11 +8382,8 @@ export function init(RuntimeName, PHPLoader) { dlSetError(`'Could not load dynamic lib: ${filename}\n${e}`); runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -8396,11 +8391,8 @@ export function init(RuntimeName, PHPLoader) { function successCallback() { runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -17969,11 +17961,8 @@ export function init(RuntimeName, PHPLoader) { var trace = getCallstack(); var parts = trace.split('\n'); for (var i = 0; i < parts.length; i++) { - var ret = (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0, + var ret = ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0, arg ); if (ret !== 0) return; @@ -18517,12 +18506,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(e.locale || '', keyEventData + 128, 32); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, keyEventData, userData ) @@ -18640,12 +18625,8 @@ export function init(RuntimeName, PHPLoader) { fillMouseEventData(JSEvents.mouseEvent, e, target); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.mouseEvent, userData ) @@ -18859,12 +18840,8 @@ export function init(RuntimeName, PHPLoader) { HEAPF64[(wheelEvent + 80) >> 3] = e['deltaZ']; HEAP32[(wheelEvent + 88) >> 2] = e['deltaMode']; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, wheelEvent, userData ) @@ -18945,12 +18922,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(uiEvent + 28) >> 2] = pageXOffset | 0; // scroll offsets are float HEAP32[(uiEvent + 32) >> 2] = pageYOffset | 0; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, uiEvent, userData ) @@ -19024,12 +18997,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(id, focusEvent + 128, 128); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, focusEvent, userData ) @@ -19145,12 +19114,8 @@ export function init(RuntimeName, PHPLoader) { ); // TODO: Thread-safety with respect to emscripten_get_deviceorientation_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceOrientationEvent, userData ) @@ -19234,12 +19199,8 @@ export function init(RuntimeName, PHPLoader) { fillDeviceMotionEventData(JSEvents.deviceMotionEvent, e, target); // TODO: Thread-safety with respect to emscripten_get_devicemotion_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceMotionEvent, userData ) @@ -19346,12 +19307,8 @@ export function init(RuntimeName, PHPLoader) { fillOrientationChangeEventData(orientationChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, orientationChangeEvent, userData ) @@ -19480,12 +19437,8 @@ export function init(RuntimeName, PHPLoader) { fillFullscreenChangeEventData(fullscreenChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, fullscreenChangeEvent, userData ) @@ -19630,12 +19583,8 @@ export function init(RuntimeName, PHPLoader) { ); if (currentFullscreenStrategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19736,12 +19685,8 @@ export function init(RuntimeName, PHPLoader) { currentFullscreenStrategy = strategy; if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19841,12 +19786,8 @@ export function init(RuntimeName, PHPLoader) { !inCenteredWithoutScalingFullscreenMode && currentFullscreenStrategy.canvasResizedCallback ) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19945,12 +19886,8 @@ export function init(RuntimeName, PHPLoader) { softFullscreenResizeWebGLRenderTarget ); if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19963,12 +19900,8 @@ export function init(RuntimeName, PHPLoader) { // Inform the caller that the canvas size has changed. if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -20030,12 +19963,8 @@ export function init(RuntimeName, PHPLoader) { fillPointerlockChangeEventData(pointerlockChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, pointerlockChangeEvent, userData ) @@ -20089,12 +20018,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var pointerlockErrorEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -20248,12 +20173,8 @@ export function init(RuntimeName, PHPLoader) { fillVisibilityChangeEventData(visibilityChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, visibilityChangeEvent, userData ) @@ -20373,12 +20294,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(touchEvent + 8) >> 2] = numTouches; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, touchEvent, userData ) @@ -20516,12 +20433,8 @@ export function init(RuntimeName, PHPLoader) { fillGamepadEventData(gamepadEvent, e['gamepad']); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, gamepadEvent, userData ) @@ -20623,12 +20536,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var beforeUnloadEventHandlerFunc = (e = event) => { // Note: This is always called on the main browser thread, since it needs synchronously return a value! - var confirmationMessage = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + var confirmationMessage = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ); @@ -20699,12 +20608,8 @@ export function init(RuntimeName, PHPLoader) { fillBatteryEventData(batteryEvent, battery); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, batteryEvent, userData ) @@ -20806,11 +20711,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame((timeStamp) => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ); @@ -20822,11 +20724,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame_loop = (cb, userData) => { function tick(timeStamp) { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ) { @@ -21083,10 +20982,8 @@ export function init(RuntimeName, PHPLoader) { return emSetImmediate(() => { runtimeKeepalivePop(); callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }); @@ -21103,10 +21000,8 @@ export function init(RuntimeName, PHPLoader) { function tick() { callUserCallback(() => { if ( - (( - a1 - ) => {}) /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ) { emSetImmediate(tick); @@ -21123,10 +21018,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_timeout = (cb, msecs, userData) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ), msecs ); @@ -21142,11 +21035,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - t, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ t, userData ) ) { @@ -21170,10 +21060,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePush(); return setInterval(() => { callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }, msecs); @@ -21188,10 +21076,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_async_call = (func, arg, millis) => { var wrapper = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); if ( @@ -21224,7 +21110,7 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_main_loop = (func, fps, simulateInfiniteLoop) => { var iterFunc = - () => {} /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */; + () => {}; /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ setMainLoop(iterFunc, fps, simulateInfiniteLoop); }; _emscripten_set_main_loop.sig = 'vpii'; @@ -21236,10 +21122,8 @@ export function init(RuntimeName, PHPLoader) { simulateInfiniteLoop ) => { var iterFunc = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); setMainLoop(iterFunc, fps, simulateInfiniteLoop, arg); }; @@ -21260,10 +21144,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21276,10 +21158,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_uncounted_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21313,12 +21193,8 @@ export function init(RuntimeName, PHPLoader) { var resultPtr = stackAlloc(POINTER_SIZE); HEAPU32[resultPtr >> 2] = 0; try { - var result = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - resultPtr, + var result = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ resultPtr, userData, value ); @@ -22155,19 +22031,15 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, true // don'tCreateFile - it's already there @@ -22201,21 +22073,16 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, cname ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, true // don'tCreateFile - it's already there @@ -22483,10 +22350,10 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => withStackSave(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stringToUTF8OnStack(_file) + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stringToUTF8OnStack( + _file + ) ) ) ); @@ -22530,12 +22397,8 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata, buffer, byteArray.length ); @@ -22545,10 +22408,8 @@ export function init(RuntimeName, PHPLoader) { if (onerror) { runtimeKeepalivePop(); callUserCallback(() => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata ); }); } @@ -22604,12 +22465,8 @@ export function init(RuntimeName, PHPLoader) { ); if (onload) { var sp = stackSave(); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, stringToUTF8OnStack(_file) ); @@ -22617,12 +22474,8 @@ export function init(RuntimeName, PHPLoader) { } } else { if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22635,12 +22488,8 @@ export function init(RuntimeName, PHPLoader) { http.onerror = (e) => { runtimeKeepalivePop(); if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22655,12 +22504,8 @@ export function init(RuntimeName, PHPLoader) { ) { var percentComplete = (e.loaded / e.total) * 100; if (onprogress) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, percentComplete ); @@ -22717,13 +22562,8 @@ export function init(RuntimeName, PHPLoader) { if (http.statusText) { statusText = stringToUTF8OnStack(http.statusText); } - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status, statusText @@ -22744,13 +22584,8 @@ export function init(RuntimeName, PHPLoader) { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); if (onload) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, buffer, byteArray.length @@ -22771,13 +22606,8 @@ export function init(RuntimeName, PHPLoader) { // PROGRESS http.onprogress = (e) => { if (onprogress) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, e.loaded, e.lengthComputable || e.lengthComputable === undefined @@ -23108,24 +22938,16 @@ export function init(RuntimeName, PHPLoader) { if (event === 'error') { withStackSave(() => { var msg = stringToUTF8OnStack(data[2]); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data[0], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data[0], data[1], msg, userData ); }); } else { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data, userData ); } @@ -24078,12 +23900,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var webGlEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -24302,21 +24120,15 @@ export function init(RuntimeName, PHPLoader) { ) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } else if (GLUT.buttons != 0 && GLUT.motionFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } @@ -24477,12 +24289,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24492,12 +24300,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24512,12 +24316,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24527,12 +24327,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24596,13 +24392,10 @@ export function init(RuntimeName, PHPLoader) { } catch (e) {} event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24617,13 +24410,10 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 1 /*GLUT_UP*/, Browser.mouseX, Browser.mouseY @@ -24652,13 +24442,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - button, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ button, 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24696,11 +24481,8 @@ export function init(RuntimeName, PHPLoader) { /* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */ if (GLUT.reshapeFunc) { // out("GLUT.reshapeFunc (from FS): " + width + ", " + height); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24756,11 +24538,8 @@ export function init(RuntimeName, PHPLoader) { // Resize callback stage 2: updateResizeListeners notifies reshapeFunc Browser.resizeListeners.push((width, height) => { if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24875,10 +24654,8 @@ export function init(RuntimeName, PHPLoader) { var _glutTimerFunc = (msec, func, value) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - value + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ value ), msec ); @@ -25038,11 +24815,8 @@ export function init(RuntimeName, PHPLoader) { Browser.setCanvasSize(width, height, true); // N.B. GLUT.reshapeFunc is also registered as a canvas resize callback. // Just call it once here. if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -26096,21 +25870,15 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, buffer, byteArray.length ); @@ -26142,18 +25910,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onstore) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); } @@ -26168,18 +25932,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (ondelete) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26196,19 +25956,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (oncheck) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, exists ); }); @@ -26224,18 +25979,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onclear) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26392,11 +26143,8 @@ export function init(RuntimeName, PHPLoader) { safeSetTimeout(() => { var stackBegin = Asyncify.currData + 12; var stackEnd = HEAPU32[Asyncify.currData >> 2]; - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stackBegin, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stackBegin, stackEnd ); wakeUp(); @@ -26445,10 +26193,8 @@ export function init(RuntimeName, PHPLoader) { HEAPU32[(newFiber + 12) >> 2] = 0; var userData = HEAPU32[(newFiber + 16) >> 2]; - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ); } else { var asyncifyData = newFiber + 20; @@ -27459,11 +27205,8 @@ export function init(RuntimeName, PHPLoader) { if (!SDL.eventHandler) return; while (SDL.pollEvent(SDL.eventHandlerTemp)) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.eventHandlerContext, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL.eventHandlerContext, SDL.eventHandlerTemp ); } @@ -29087,12 +28830,9 @@ export function init(RuntimeName, PHPLoader) { return; // Ask SDL audio data from the user code. - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.audio.userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL + .audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize ); @@ -29550,10 +29290,8 @@ export function init(RuntimeName, PHPLoader) { info.audio = null; } if (SDL.channelFinished) { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); } } @@ -29621,10 +29359,8 @@ export function init(RuntimeName, PHPLoader) { channelInfo.audio = null; } if (SDL.channelFinished) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); }; if (channelInfo.audio) { @@ -30359,11 +30095,8 @@ export function init(RuntimeName, PHPLoader) { var _SDL_AddTimer = (interval, callback, param) => safeSetTimeout( () => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - interval, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ interval, param ), interval @@ -30744,12 +30477,8 @@ export function init(RuntimeName, PHPLoader) { socket.onopen = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30771,12 +30500,8 @@ export function init(RuntimeName, PHPLoader) { socket.onerror = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30801,12 +30526,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAP8[eventPtr + 4] = e.wasClean), (HEAP16[(eventPtr + 6) >> 1] = e.code), stringToUTF8(e.reason, eventPtr + 8, 512)); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30840,12 +30561,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAPU32[(eventPtr + 4) >> 2] = buf), (HEAP32[(eventPtr + 8) >> 2] = len), (HEAP8[eventPtr + 12] = isText), - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData )); diff --git a/packages/php-wasm/node/asyncify/php_8_0.js b/packages/php-wasm/node/asyncify/php_8_0.js index 8703f654c1..c98e546bce 100644 --- a/packages/php-wasm/node/asyncify/php_8_0.js +++ b/packages/php-wasm/node/asyncify/php_8_0.js @@ -5118,10 +5118,8 @@ export function init(RuntimeName, PHPLoader) { ); var ___call_sighandler = (fp, sig) => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - sig + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ sig ); ___call_sighandler.sig = 'vpi'; @@ -8384,11 +8382,8 @@ export function init(RuntimeName, PHPLoader) { dlSetError(`'Could not load dynamic lib: ${filename}\n${e}`); runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -8396,11 +8391,8 @@ export function init(RuntimeName, PHPLoader) { function successCallback() { runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -17969,11 +17961,8 @@ export function init(RuntimeName, PHPLoader) { var trace = getCallstack(); var parts = trace.split('\n'); for (var i = 0; i < parts.length; i++) { - var ret = (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0, + var ret = ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0, arg ); if (ret !== 0) return; @@ -18517,12 +18506,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(e.locale || '', keyEventData + 128, 32); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, keyEventData, userData ) @@ -18640,12 +18625,8 @@ export function init(RuntimeName, PHPLoader) { fillMouseEventData(JSEvents.mouseEvent, e, target); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.mouseEvent, userData ) @@ -18859,12 +18840,8 @@ export function init(RuntimeName, PHPLoader) { HEAPF64[(wheelEvent + 80) >> 3] = e['deltaZ']; HEAP32[(wheelEvent + 88) >> 2] = e['deltaMode']; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, wheelEvent, userData ) @@ -18945,12 +18922,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(uiEvent + 28) >> 2] = pageXOffset | 0; // scroll offsets are float HEAP32[(uiEvent + 32) >> 2] = pageYOffset | 0; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, uiEvent, userData ) @@ -19024,12 +18997,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(id, focusEvent + 128, 128); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, focusEvent, userData ) @@ -19145,12 +19114,8 @@ export function init(RuntimeName, PHPLoader) { ); // TODO: Thread-safety with respect to emscripten_get_deviceorientation_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceOrientationEvent, userData ) @@ -19234,12 +19199,8 @@ export function init(RuntimeName, PHPLoader) { fillDeviceMotionEventData(JSEvents.deviceMotionEvent, e, target); // TODO: Thread-safety with respect to emscripten_get_devicemotion_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceMotionEvent, userData ) @@ -19346,12 +19307,8 @@ export function init(RuntimeName, PHPLoader) { fillOrientationChangeEventData(orientationChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, orientationChangeEvent, userData ) @@ -19480,12 +19437,8 @@ export function init(RuntimeName, PHPLoader) { fillFullscreenChangeEventData(fullscreenChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, fullscreenChangeEvent, userData ) @@ -19630,12 +19583,8 @@ export function init(RuntimeName, PHPLoader) { ); if (currentFullscreenStrategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19736,12 +19685,8 @@ export function init(RuntimeName, PHPLoader) { currentFullscreenStrategy = strategy; if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19841,12 +19786,8 @@ export function init(RuntimeName, PHPLoader) { !inCenteredWithoutScalingFullscreenMode && currentFullscreenStrategy.canvasResizedCallback ) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19945,12 +19886,8 @@ export function init(RuntimeName, PHPLoader) { softFullscreenResizeWebGLRenderTarget ); if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19963,12 +19900,8 @@ export function init(RuntimeName, PHPLoader) { // Inform the caller that the canvas size has changed. if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -20030,12 +19963,8 @@ export function init(RuntimeName, PHPLoader) { fillPointerlockChangeEventData(pointerlockChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, pointerlockChangeEvent, userData ) @@ -20089,12 +20018,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var pointerlockErrorEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -20248,12 +20173,8 @@ export function init(RuntimeName, PHPLoader) { fillVisibilityChangeEventData(visibilityChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, visibilityChangeEvent, userData ) @@ -20373,12 +20294,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(touchEvent + 8) >> 2] = numTouches; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, touchEvent, userData ) @@ -20516,12 +20433,8 @@ export function init(RuntimeName, PHPLoader) { fillGamepadEventData(gamepadEvent, e['gamepad']); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, gamepadEvent, userData ) @@ -20623,12 +20536,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var beforeUnloadEventHandlerFunc = (e = event) => { // Note: This is always called on the main browser thread, since it needs synchronously return a value! - var confirmationMessage = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + var confirmationMessage = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ); @@ -20699,12 +20608,8 @@ export function init(RuntimeName, PHPLoader) { fillBatteryEventData(batteryEvent, battery); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, batteryEvent, userData ) @@ -20806,11 +20711,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame((timeStamp) => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ); @@ -20822,11 +20724,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame_loop = (cb, userData) => { function tick(timeStamp) { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ) { @@ -21083,10 +20982,8 @@ export function init(RuntimeName, PHPLoader) { return emSetImmediate(() => { runtimeKeepalivePop(); callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }); @@ -21103,10 +21000,8 @@ export function init(RuntimeName, PHPLoader) { function tick() { callUserCallback(() => { if ( - (( - a1 - ) => {}) /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ) { emSetImmediate(tick); @@ -21123,10 +21018,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_timeout = (cb, msecs, userData) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ), msecs ); @@ -21142,11 +21035,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - t, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ t, userData ) ) { @@ -21170,10 +21060,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePush(); return setInterval(() => { callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }, msecs); @@ -21188,10 +21076,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_async_call = (func, arg, millis) => { var wrapper = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); if ( @@ -21224,7 +21110,7 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_main_loop = (func, fps, simulateInfiniteLoop) => { var iterFunc = - () => {} /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */; + () => {}; /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ setMainLoop(iterFunc, fps, simulateInfiniteLoop); }; _emscripten_set_main_loop.sig = 'vpii'; @@ -21236,10 +21122,8 @@ export function init(RuntimeName, PHPLoader) { simulateInfiniteLoop ) => { var iterFunc = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); setMainLoop(iterFunc, fps, simulateInfiniteLoop, arg); }; @@ -21260,10 +21144,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21276,10 +21158,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_uncounted_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21313,12 +21193,8 @@ export function init(RuntimeName, PHPLoader) { var resultPtr = stackAlloc(POINTER_SIZE); HEAPU32[resultPtr >> 2] = 0; try { - var result = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - resultPtr, + var result = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ resultPtr, userData, value ); @@ -22155,19 +22031,15 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, true // don'tCreateFile - it's already there @@ -22201,21 +22073,16 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, cname ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, true // don'tCreateFile - it's already there @@ -22483,10 +22350,10 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => withStackSave(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stringToUTF8OnStack(_file) + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stringToUTF8OnStack( + _file + ) ) ) ); @@ -22530,12 +22397,8 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata, buffer, byteArray.length ); @@ -22545,10 +22408,8 @@ export function init(RuntimeName, PHPLoader) { if (onerror) { runtimeKeepalivePop(); callUserCallback(() => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata ); }); } @@ -22604,12 +22465,8 @@ export function init(RuntimeName, PHPLoader) { ); if (onload) { var sp = stackSave(); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, stringToUTF8OnStack(_file) ); @@ -22617,12 +22474,8 @@ export function init(RuntimeName, PHPLoader) { } } else { if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22635,12 +22488,8 @@ export function init(RuntimeName, PHPLoader) { http.onerror = (e) => { runtimeKeepalivePop(); if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22655,12 +22504,8 @@ export function init(RuntimeName, PHPLoader) { ) { var percentComplete = (e.loaded / e.total) * 100; if (onprogress) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, percentComplete ); @@ -22717,13 +22562,8 @@ export function init(RuntimeName, PHPLoader) { if (http.statusText) { statusText = stringToUTF8OnStack(http.statusText); } - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status, statusText @@ -22744,13 +22584,8 @@ export function init(RuntimeName, PHPLoader) { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); if (onload) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, buffer, byteArray.length @@ -22771,13 +22606,8 @@ export function init(RuntimeName, PHPLoader) { // PROGRESS http.onprogress = (e) => { if (onprogress) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, e.loaded, e.lengthComputable || e.lengthComputable === undefined @@ -23108,24 +22938,16 @@ export function init(RuntimeName, PHPLoader) { if (event === 'error') { withStackSave(() => { var msg = stringToUTF8OnStack(data[2]); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data[0], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data[0], data[1], msg, userData ); }); } else { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data, userData ); } @@ -24078,12 +23900,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var webGlEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -24302,21 +24120,15 @@ export function init(RuntimeName, PHPLoader) { ) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } else if (GLUT.buttons != 0 && GLUT.motionFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } @@ -24477,12 +24289,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24492,12 +24300,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24512,12 +24316,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24527,12 +24327,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24596,13 +24392,10 @@ export function init(RuntimeName, PHPLoader) { } catch (e) {} event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24617,13 +24410,10 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 1 /*GLUT_UP*/, Browser.mouseX, Browser.mouseY @@ -24652,13 +24442,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - button, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ button, 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24696,11 +24481,8 @@ export function init(RuntimeName, PHPLoader) { /* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */ if (GLUT.reshapeFunc) { // out("GLUT.reshapeFunc (from FS): " + width + ", " + height); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24756,11 +24538,8 @@ export function init(RuntimeName, PHPLoader) { // Resize callback stage 2: updateResizeListeners notifies reshapeFunc Browser.resizeListeners.push((width, height) => { if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24875,10 +24654,8 @@ export function init(RuntimeName, PHPLoader) { var _glutTimerFunc = (msec, func, value) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - value + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ value ), msec ); @@ -25038,11 +24815,8 @@ export function init(RuntimeName, PHPLoader) { Browser.setCanvasSize(width, height, true); // N.B. GLUT.reshapeFunc is also registered as a canvas resize callback. // Just call it once here. if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -26096,21 +25870,15 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, buffer, byteArray.length ); @@ -26142,18 +25910,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onstore) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); } @@ -26168,18 +25932,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (ondelete) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26196,19 +25956,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (oncheck) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, exists ); }); @@ -26224,18 +25979,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onclear) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26392,11 +26143,8 @@ export function init(RuntimeName, PHPLoader) { safeSetTimeout(() => { var stackBegin = Asyncify.currData + 12; var stackEnd = HEAPU32[Asyncify.currData >> 2]; - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stackBegin, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stackBegin, stackEnd ); wakeUp(); @@ -26445,10 +26193,8 @@ export function init(RuntimeName, PHPLoader) { HEAPU32[(newFiber + 12) >> 2] = 0; var userData = HEAPU32[(newFiber + 16) >> 2]; - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ); } else { var asyncifyData = newFiber + 20; @@ -27459,11 +27205,8 @@ export function init(RuntimeName, PHPLoader) { if (!SDL.eventHandler) return; while (SDL.pollEvent(SDL.eventHandlerTemp)) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.eventHandlerContext, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL.eventHandlerContext, SDL.eventHandlerTemp ); } @@ -29087,12 +28830,9 @@ export function init(RuntimeName, PHPLoader) { return; // Ask SDL audio data from the user code. - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.audio.userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL + .audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize ); @@ -29550,10 +29290,8 @@ export function init(RuntimeName, PHPLoader) { info.audio = null; } if (SDL.channelFinished) { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); } } @@ -29621,10 +29359,8 @@ export function init(RuntimeName, PHPLoader) { channelInfo.audio = null; } if (SDL.channelFinished) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); }; if (channelInfo.audio) { @@ -30359,11 +30095,8 @@ export function init(RuntimeName, PHPLoader) { var _SDL_AddTimer = (interval, callback, param) => safeSetTimeout( () => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - interval, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ interval, param ), interval @@ -30744,12 +30477,8 @@ export function init(RuntimeName, PHPLoader) { socket.onopen = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30771,12 +30500,8 @@ export function init(RuntimeName, PHPLoader) { socket.onerror = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30801,12 +30526,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAP8[eventPtr + 4] = e.wasClean), (HEAP16[(eventPtr + 6) >> 1] = e.code), stringToUTF8(e.reason, eventPtr + 8, 512)); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30840,12 +30561,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAPU32[(eventPtr + 4) >> 2] = buf), (HEAP32[(eventPtr + 8) >> 2] = len), (HEAP8[eventPtr + 12] = isText), - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData )); diff --git a/packages/php-wasm/node/asyncify/php_8_1.js b/packages/php-wasm/node/asyncify/php_8_1.js index ff426f46ea..a5ccdd4add 100644 --- a/packages/php-wasm/node/asyncify/php_8_1.js +++ b/packages/php-wasm/node/asyncify/php_8_1.js @@ -5118,10 +5118,8 @@ export function init(RuntimeName, PHPLoader) { ); var ___call_sighandler = (fp, sig) => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - sig + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ sig ); ___call_sighandler.sig = 'vpi'; @@ -8384,11 +8382,8 @@ export function init(RuntimeName, PHPLoader) { dlSetError(`'Could not load dynamic lib: ${filename}\n${e}`); runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -8396,11 +8391,8 @@ export function init(RuntimeName, PHPLoader) { function successCallback() { runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -17975,11 +17967,8 @@ export function init(RuntimeName, PHPLoader) { var trace = getCallstack(); var parts = trace.split('\n'); for (var i = 0; i < parts.length; i++) { - var ret = (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0, + var ret = ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0, arg ); if (ret !== 0) return; @@ -18523,12 +18512,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(e.locale || '', keyEventData + 128, 32); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, keyEventData, userData ) @@ -18646,12 +18631,8 @@ export function init(RuntimeName, PHPLoader) { fillMouseEventData(JSEvents.mouseEvent, e, target); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.mouseEvent, userData ) @@ -18865,12 +18846,8 @@ export function init(RuntimeName, PHPLoader) { HEAPF64[(wheelEvent + 80) >> 3] = e['deltaZ']; HEAP32[(wheelEvent + 88) >> 2] = e['deltaMode']; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, wheelEvent, userData ) @@ -18951,12 +18928,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(uiEvent + 28) >> 2] = pageXOffset | 0; // scroll offsets are float HEAP32[(uiEvent + 32) >> 2] = pageYOffset | 0; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, uiEvent, userData ) @@ -19030,12 +19003,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(id, focusEvent + 128, 128); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, focusEvent, userData ) @@ -19151,12 +19120,8 @@ export function init(RuntimeName, PHPLoader) { ); // TODO: Thread-safety with respect to emscripten_get_deviceorientation_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceOrientationEvent, userData ) @@ -19240,12 +19205,8 @@ export function init(RuntimeName, PHPLoader) { fillDeviceMotionEventData(JSEvents.deviceMotionEvent, e, target); // TODO: Thread-safety with respect to emscripten_get_devicemotion_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceMotionEvent, userData ) @@ -19352,12 +19313,8 @@ export function init(RuntimeName, PHPLoader) { fillOrientationChangeEventData(orientationChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, orientationChangeEvent, userData ) @@ -19486,12 +19443,8 @@ export function init(RuntimeName, PHPLoader) { fillFullscreenChangeEventData(fullscreenChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, fullscreenChangeEvent, userData ) @@ -19636,12 +19589,8 @@ export function init(RuntimeName, PHPLoader) { ); if (currentFullscreenStrategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19742,12 +19691,8 @@ export function init(RuntimeName, PHPLoader) { currentFullscreenStrategy = strategy; if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19847,12 +19792,8 @@ export function init(RuntimeName, PHPLoader) { !inCenteredWithoutScalingFullscreenMode && currentFullscreenStrategy.canvasResizedCallback ) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19951,12 +19892,8 @@ export function init(RuntimeName, PHPLoader) { softFullscreenResizeWebGLRenderTarget ); if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19969,12 +19906,8 @@ export function init(RuntimeName, PHPLoader) { // Inform the caller that the canvas size has changed. if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -20036,12 +19969,8 @@ export function init(RuntimeName, PHPLoader) { fillPointerlockChangeEventData(pointerlockChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, pointerlockChangeEvent, userData ) @@ -20095,12 +20024,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var pointerlockErrorEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -20254,12 +20179,8 @@ export function init(RuntimeName, PHPLoader) { fillVisibilityChangeEventData(visibilityChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, visibilityChangeEvent, userData ) @@ -20379,12 +20300,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(touchEvent + 8) >> 2] = numTouches; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, touchEvent, userData ) @@ -20522,12 +20439,8 @@ export function init(RuntimeName, PHPLoader) { fillGamepadEventData(gamepadEvent, e['gamepad']); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, gamepadEvent, userData ) @@ -20629,12 +20542,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var beforeUnloadEventHandlerFunc = (e = event) => { // Note: This is always called on the main browser thread, since it needs synchronously return a value! - var confirmationMessage = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + var confirmationMessage = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ); @@ -20705,12 +20614,8 @@ export function init(RuntimeName, PHPLoader) { fillBatteryEventData(batteryEvent, battery); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, batteryEvent, userData ) @@ -20812,11 +20717,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame((timeStamp) => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ); @@ -20828,11 +20730,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame_loop = (cb, userData) => { function tick(timeStamp) { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ) { @@ -21089,10 +20988,8 @@ export function init(RuntimeName, PHPLoader) { return emSetImmediate(() => { runtimeKeepalivePop(); callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }); @@ -21109,10 +21006,8 @@ export function init(RuntimeName, PHPLoader) { function tick() { callUserCallback(() => { if ( - (( - a1 - ) => {}) /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ) { emSetImmediate(tick); @@ -21129,10 +21024,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_timeout = (cb, msecs, userData) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ), msecs ); @@ -21148,11 +21041,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - t, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ t, userData ) ) { @@ -21176,10 +21066,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePush(); return setInterval(() => { callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }, msecs); @@ -21194,10 +21082,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_async_call = (func, arg, millis) => { var wrapper = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); if ( @@ -21230,7 +21116,7 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_main_loop = (func, fps, simulateInfiniteLoop) => { var iterFunc = - () => {} /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */; + () => {}; /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ setMainLoop(iterFunc, fps, simulateInfiniteLoop); }; _emscripten_set_main_loop.sig = 'vpii'; @@ -21242,10 +21128,8 @@ export function init(RuntimeName, PHPLoader) { simulateInfiniteLoop ) => { var iterFunc = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); setMainLoop(iterFunc, fps, simulateInfiniteLoop, arg); }; @@ -21266,10 +21150,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21282,10 +21164,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_uncounted_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21319,12 +21199,8 @@ export function init(RuntimeName, PHPLoader) { var resultPtr = stackAlloc(POINTER_SIZE); HEAPU32[resultPtr >> 2] = 0; try { - var result = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - resultPtr, + var result = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ resultPtr, userData, value ); @@ -22161,19 +22037,15 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, true // don'tCreateFile - it's already there @@ -22207,21 +22079,16 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, cname ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, true // don'tCreateFile - it's already there @@ -22489,10 +22356,10 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => withStackSave(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stringToUTF8OnStack(_file) + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stringToUTF8OnStack( + _file + ) ) ) ); @@ -22536,12 +22403,8 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata, buffer, byteArray.length ); @@ -22551,10 +22414,8 @@ export function init(RuntimeName, PHPLoader) { if (onerror) { runtimeKeepalivePop(); callUserCallback(() => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata ); }); } @@ -22610,12 +22471,8 @@ export function init(RuntimeName, PHPLoader) { ); if (onload) { var sp = stackSave(); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, stringToUTF8OnStack(_file) ); @@ -22623,12 +22480,8 @@ export function init(RuntimeName, PHPLoader) { } } else { if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22641,12 +22494,8 @@ export function init(RuntimeName, PHPLoader) { http.onerror = (e) => { runtimeKeepalivePop(); if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22661,12 +22510,8 @@ export function init(RuntimeName, PHPLoader) { ) { var percentComplete = (e.loaded / e.total) * 100; if (onprogress) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, percentComplete ); @@ -22723,13 +22568,8 @@ export function init(RuntimeName, PHPLoader) { if (http.statusText) { statusText = stringToUTF8OnStack(http.statusText); } - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status, statusText @@ -22750,13 +22590,8 @@ export function init(RuntimeName, PHPLoader) { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); if (onload) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, buffer, byteArray.length @@ -22777,13 +22612,8 @@ export function init(RuntimeName, PHPLoader) { // PROGRESS http.onprogress = (e) => { if (onprogress) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, e.loaded, e.lengthComputable || e.lengthComputable === undefined @@ -23114,24 +22944,16 @@ export function init(RuntimeName, PHPLoader) { if (event === 'error') { withStackSave(() => { var msg = stringToUTF8OnStack(data[2]); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data[0], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data[0], data[1], msg, userData ); }); } else { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data, userData ); } @@ -24084,12 +23906,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var webGlEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -24308,21 +24126,15 @@ export function init(RuntimeName, PHPLoader) { ) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } else if (GLUT.buttons != 0 && GLUT.motionFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } @@ -24483,12 +24295,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24498,12 +24306,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24518,12 +24322,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24533,12 +24333,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24602,13 +24398,10 @@ export function init(RuntimeName, PHPLoader) { } catch (e) {} event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24623,13 +24416,10 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 1 /*GLUT_UP*/, Browser.mouseX, Browser.mouseY @@ -24658,13 +24448,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - button, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ button, 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24702,11 +24487,8 @@ export function init(RuntimeName, PHPLoader) { /* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */ if (GLUT.reshapeFunc) { // out("GLUT.reshapeFunc (from FS): " + width + ", " + height); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24762,11 +24544,8 @@ export function init(RuntimeName, PHPLoader) { // Resize callback stage 2: updateResizeListeners notifies reshapeFunc Browser.resizeListeners.push((width, height) => { if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24881,10 +24660,8 @@ export function init(RuntimeName, PHPLoader) { var _glutTimerFunc = (msec, func, value) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - value + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ value ), msec ); @@ -25044,11 +24821,8 @@ export function init(RuntimeName, PHPLoader) { Browser.setCanvasSize(width, height, true); // N.B. GLUT.reshapeFunc is also registered as a canvas resize callback. // Just call it once here. if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -26102,21 +25876,15 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, buffer, byteArray.length ); @@ -26148,18 +25916,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onstore) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); } @@ -26174,18 +25938,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (ondelete) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26202,19 +25962,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (oncheck) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, exists ); }); @@ -26230,18 +25985,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onclear) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26398,11 +26149,8 @@ export function init(RuntimeName, PHPLoader) { safeSetTimeout(() => { var stackBegin = Asyncify.currData + 12; var stackEnd = HEAPU32[Asyncify.currData >> 2]; - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stackBegin, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stackBegin, stackEnd ); wakeUp(); @@ -26451,10 +26199,8 @@ export function init(RuntimeName, PHPLoader) { HEAPU32[(newFiber + 12) >> 2] = 0; var userData = HEAPU32[(newFiber + 16) >> 2]; - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ); } else { var asyncifyData = newFiber + 20; @@ -27465,11 +27211,8 @@ export function init(RuntimeName, PHPLoader) { if (!SDL.eventHandler) return; while (SDL.pollEvent(SDL.eventHandlerTemp)) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.eventHandlerContext, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL.eventHandlerContext, SDL.eventHandlerTemp ); } @@ -29093,12 +28836,9 @@ export function init(RuntimeName, PHPLoader) { return; // Ask SDL audio data from the user code. - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.audio.userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL + .audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize ); @@ -29556,10 +29296,8 @@ export function init(RuntimeName, PHPLoader) { info.audio = null; } if (SDL.channelFinished) { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); } } @@ -29627,10 +29365,8 @@ export function init(RuntimeName, PHPLoader) { channelInfo.audio = null; } if (SDL.channelFinished) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); }; if (channelInfo.audio) { @@ -30365,11 +30101,8 @@ export function init(RuntimeName, PHPLoader) { var _SDL_AddTimer = (interval, callback, param) => safeSetTimeout( () => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - interval, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ interval, param ), interval @@ -30744,12 +30477,8 @@ export function init(RuntimeName, PHPLoader) { socket.onopen = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30771,12 +30500,8 @@ export function init(RuntimeName, PHPLoader) { socket.onerror = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30801,12 +30526,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAP8[eventPtr + 4] = e.wasClean), (HEAP16[(eventPtr + 6) >> 1] = e.code), stringToUTF8(e.reason, eventPtr + 8, 512)); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30840,12 +30561,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAPU32[(eventPtr + 4) >> 2] = buf), (HEAP32[(eventPtr + 8) >> 2] = len), (HEAP8[eventPtr + 12] = isText), - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData )); diff --git a/packages/php-wasm/node/asyncify/php_8_2.js b/packages/php-wasm/node/asyncify/php_8_2.js index bfab213e3a..136c10efdc 100644 --- a/packages/php-wasm/node/asyncify/php_8_2.js +++ b/packages/php-wasm/node/asyncify/php_8_2.js @@ -5118,10 +5118,8 @@ export function init(RuntimeName, PHPLoader) { ); var ___call_sighandler = (fp, sig) => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - sig + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ sig ); ___call_sighandler.sig = 'vpi'; @@ -8384,11 +8382,8 @@ export function init(RuntimeName, PHPLoader) { dlSetError(`'Could not load dynamic lib: ${filename}\n${e}`); runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -8396,11 +8391,8 @@ export function init(RuntimeName, PHPLoader) { function successCallback() { runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -17977,11 +17969,8 @@ export function init(RuntimeName, PHPLoader) { var trace = getCallstack(); var parts = trace.split('\n'); for (var i = 0; i < parts.length; i++) { - var ret = (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0, + var ret = ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0, arg ); if (ret !== 0) return; @@ -18525,12 +18514,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(e.locale || '', keyEventData + 128, 32); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, keyEventData, userData ) @@ -18648,12 +18633,8 @@ export function init(RuntimeName, PHPLoader) { fillMouseEventData(JSEvents.mouseEvent, e, target); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.mouseEvent, userData ) @@ -18867,12 +18848,8 @@ export function init(RuntimeName, PHPLoader) { HEAPF64[(wheelEvent + 80) >> 3] = e['deltaZ']; HEAP32[(wheelEvent + 88) >> 2] = e['deltaMode']; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, wheelEvent, userData ) @@ -18953,12 +18930,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(uiEvent + 28) >> 2] = pageXOffset | 0; // scroll offsets are float HEAP32[(uiEvent + 32) >> 2] = pageYOffset | 0; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, uiEvent, userData ) @@ -19032,12 +19005,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(id, focusEvent + 128, 128); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, focusEvent, userData ) @@ -19153,12 +19122,8 @@ export function init(RuntimeName, PHPLoader) { ); // TODO: Thread-safety with respect to emscripten_get_deviceorientation_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceOrientationEvent, userData ) @@ -19242,12 +19207,8 @@ export function init(RuntimeName, PHPLoader) { fillDeviceMotionEventData(JSEvents.deviceMotionEvent, e, target); // TODO: Thread-safety with respect to emscripten_get_devicemotion_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceMotionEvent, userData ) @@ -19354,12 +19315,8 @@ export function init(RuntimeName, PHPLoader) { fillOrientationChangeEventData(orientationChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, orientationChangeEvent, userData ) @@ -19488,12 +19445,8 @@ export function init(RuntimeName, PHPLoader) { fillFullscreenChangeEventData(fullscreenChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, fullscreenChangeEvent, userData ) @@ -19638,12 +19591,8 @@ export function init(RuntimeName, PHPLoader) { ); if (currentFullscreenStrategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19744,12 +19693,8 @@ export function init(RuntimeName, PHPLoader) { currentFullscreenStrategy = strategy; if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19849,12 +19794,8 @@ export function init(RuntimeName, PHPLoader) { !inCenteredWithoutScalingFullscreenMode && currentFullscreenStrategy.canvasResizedCallback ) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19953,12 +19894,8 @@ export function init(RuntimeName, PHPLoader) { softFullscreenResizeWebGLRenderTarget ); if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19971,12 +19908,8 @@ export function init(RuntimeName, PHPLoader) { // Inform the caller that the canvas size has changed. if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -20038,12 +19971,8 @@ export function init(RuntimeName, PHPLoader) { fillPointerlockChangeEventData(pointerlockChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, pointerlockChangeEvent, userData ) @@ -20097,12 +20026,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var pointerlockErrorEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -20256,12 +20181,8 @@ export function init(RuntimeName, PHPLoader) { fillVisibilityChangeEventData(visibilityChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, visibilityChangeEvent, userData ) @@ -20381,12 +20302,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(touchEvent + 8) >> 2] = numTouches; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, touchEvent, userData ) @@ -20524,12 +20441,8 @@ export function init(RuntimeName, PHPLoader) { fillGamepadEventData(gamepadEvent, e['gamepad']); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, gamepadEvent, userData ) @@ -20631,12 +20544,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var beforeUnloadEventHandlerFunc = (e = event) => { // Note: This is always called on the main browser thread, since it needs synchronously return a value! - var confirmationMessage = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + var confirmationMessage = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ); @@ -20707,12 +20616,8 @@ export function init(RuntimeName, PHPLoader) { fillBatteryEventData(batteryEvent, battery); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, batteryEvent, userData ) @@ -20814,11 +20719,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame((timeStamp) => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ); @@ -20830,11 +20732,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame_loop = (cb, userData) => { function tick(timeStamp) { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ) { @@ -21091,10 +20990,8 @@ export function init(RuntimeName, PHPLoader) { return emSetImmediate(() => { runtimeKeepalivePop(); callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }); @@ -21111,10 +21008,8 @@ export function init(RuntimeName, PHPLoader) { function tick() { callUserCallback(() => { if ( - (( - a1 - ) => {}) /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ) { emSetImmediate(tick); @@ -21131,10 +21026,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_timeout = (cb, msecs, userData) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ), msecs ); @@ -21150,11 +21043,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - t, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ t, userData ) ) { @@ -21178,10 +21068,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePush(); return setInterval(() => { callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }, msecs); @@ -21196,10 +21084,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_async_call = (func, arg, millis) => { var wrapper = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); if ( @@ -21232,7 +21118,7 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_main_loop = (func, fps, simulateInfiniteLoop) => { var iterFunc = - () => {} /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */; + () => {}; /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ setMainLoop(iterFunc, fps, simulateInfiniteLoop); }; _emscripten_set_main_loop.sig = 'vpii'; @@ -21244,10 +21130,8 @@ export function init(RuntimeName, PHPLoader) { simulateInfiniteLoop ) => { var iterFunc = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); setMainLoop(iterFunc, fps, simulateInfiniteLoop, arg); }; @@ -21268,10 +21152,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21284,10 +21166,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_uncounted_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21321,12 +21201,8 @@ export function init(RuntimeName, PHPLoader) { var resultPtr = stackAlloc(POINTER_SIZE); HEAPU32[resultPtr >> 2] = 0; try { - var result = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - resultPtr, + var result = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ resultPtr, userData, value ); @@ -22163,19 +22039,15 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, true // don'tCreateFile - it's already there @@ -22209,21 +22081,16 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, cname ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, true // don'tCreateFile - it's already there @@ -22491,10 +22358,10 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => withStackSave(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stringToUTF8OnStack(_file) + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stringToUTF8OnStack( + _file + ) ) ) ); @@ -22538,12 +22405,8 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata, buffer, byteArray.length ); @@ -22553,10 +22416,8 @@ export function init(RuntimeName, PHPLoader) { if (onerror) { runtimeKeepalivePop(); callUserCallback(() => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata ); }); } @@ -22612,12 +22473,8 @@ export function init(RuntimeName, PHPLoader) { ); if (onload) { var sp = stackSave(); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, stringToUTF8OnStack(_file) ); @@ -22625,12 +22482,8 @@ export function init(RuntimeName, PHPLoader) { } } else { if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22643,12 +22496,8 @@ export function init(RuntimeName, PHPLoader) { http.onerror = (e) => { runtimeKeepalivePop(); if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22663,12 +22512,8 @@ export function init(RuntimeName, PHPLoader) { ) { var percentComplete = (e.loaded / e.total) * 100; if (onprogress) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, percentComplete ); @@ -22725,13 +22570,8 @@ export function init(RuntimeName, PHPLoader) { if (http.statusText) { statusText = stringToUTF8OnStack(http.statusText); } - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status, statusText @@ -22752,13 +22592,8 @@ export function init(RuntimeName, PHPLoader) { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); if (onload) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, buffer, byteArray.length @@ -22779,13 +22614,8 @@ export function init(RuntimeName, PHPLoader) { // PROGRESS http.onprogress = (e) => { if (onprogress) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, e.loaded, e.lengthComputable || e.lengthComputable === undefined @@ -23116,24 +22946,16 @@ export function init(RuntimeName, PHPLoader) { if (event === 'error') { withStackSave(() => { var msg = stringToUTF8OnStack(data[2]); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data[0], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data[0], data[1], msg, userData ); }); } else { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data, userData ); } @@ -24086,12 +23908,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var webGlEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -24310,21 +24128,15 @@ export function init(RuntimeName, PHPLoader) { ) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } else if (GLUT.buttons != 0 && GLUT.motionFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } @@ -24485,12 +24297,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24500,12 +24308,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24520,12 +24324,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24535,12 +24335,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24604,13 +24400,10 @@ export function init(RuntimeName, PHPLoader) { } catch (e) {} event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24625,13 +24418,10 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 1 /*GLUT_UP*/, Browser.mouseX, Browser.mouseY @@ -24660,13 +24450,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - button, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ button, 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24704,11 +24489,8 @@ export function init(RuntimeName, PHPLoader) { /* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */ if (GLUT.reshapeFunc) { // out("GLUT.reshapeFunc (from FS): " + width + ", " + height); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24764,11 +24546,8 @@ export function init(RuntimeName, PHPLoader) { // Resize callback stage 2: updateResizeListeners notifies reshapeFunc Browser.resizeListeners.push((width, height) => { if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24883,10 +24662,8 @@ export function init(RuntimeName, PHPLoader) { var _glutTimerFunc = (msec, func, value) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - value + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ value ), msec ); @@ -25046,11 +24823,8 @@ export function init(RuntimeName, PHPLoader) { Browser.setCanvasSize(width, height, true); // N.B. GLUT.reshapeFunc is also registered as a canvas resize callback. // Just call it once here. if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -26104,21 +25878,15 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, buffer, byteArray.length ); @@ -26150,18 +25918,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onstore) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); } @@ -26176,18 +25940,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (ondelete) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26204,19 +25964,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (oncheck) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, exists ); }); @@ -26232,18 +25987,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onclear) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26400,11 +26151,8 @@ export function init(RuntimeName, PHPLoader) { safeSetTimeout(() => { var stackBegin = Asyncify.currData + 12; var stackEnd = HEAPU32[Asyncify.currData >> 2]; - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stackBegin, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stackBegin, stackEnd ); wakeUp(); @@ -26453,10 +26201,8 @@ export function init(RuntimeName, PHPLoader) { HEAPU32[(newFiber + 12) >> 2] = 0; var userData = HEAPU32[(newFiber + 16) >> 2]; - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ); } else { var asyncifyData = newFiber + 20; @@ -27467,11 +27213,8 @@ export function init(RuntimeName, PHPLoader) { if (!SDL.eventHandler) return; while (SDL.pollEvent(SDL.eventHandlerTemp)) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.eventHandlerContext, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL.eventHandlerContext, SDL.eventHandlerTemp ); } @@ -29095,12 +28838,9 @@ export function init(RuntimeName, PHPLoader) { return; // Ask SDL audio data from the user code. - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.audio.userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL + .audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize ); @@ -29558,10 +29298,8 @@ export function init(RuntimeName, PHPLoader) { info.audio = null; } if (SDL.channelFinished) { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); } } @@ -29629,10 +29367,8 @@ export function init(RuntimeName, PHPLoader) { channelInfo.audio = null; } if (SDL.channelFinished) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); }; if (channelInfo.audio) { @@ -30367,11 +30103,8 @@ export function init(RuntimeName, PHPLoader) { var _SDL_AddTimer = (interval, callback, param) => safeSetTimeout( () => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - interval, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ interval, param ), interval @@ -30744,12 +30477,8 @@ export function init(RuntimeName, PHPLoader) { socket.onopen = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30771,12 +30500,8 @@ export function init(RuntimeName, PHPLoader) { socket.onerror = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30801,12 +30526,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAP8[eventPtr + 4] = e.wasClean), (HEAP16[(eventPtr + 6) >> 1] = e.code), stringToUTF8(e.reason, eventPtr + 8, 512)); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30840,12 +30561,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAPU32[(eventPtr + 4) >> 2] = buf), (HEAP32[(eventPtr + 8) >> 2] = len), (HEAP8[eventPtr + 12] = isText), - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData )); diff --git a/packages/php-wasm/node/asyncify/php_8_3.js b/packages/php-wasm/node/asyncify/php_8_3.js index c8b118037c..11ef7fe4a6 100644 --- a/packages/php-wasm/node/asyncify/php_8_3.js +++ b/packages/php-wasm/node/asyncify/php_8_3.js @@ -5118,10 +5118,8 @@ export function init(RuntimeName, PHPLoader) { ); var ___call_sighandler = (fp, sig) => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - sig + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ sig ); ___call_sighandler.sig = 'vpi'; @@ -8384,11 +8382,8 @@ export function init(RuntimeName, PHPLoader) { dlSetError(`'Could not load dynamic lib: ${filename}\n${e}`); runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -8396,11 +8391,8 @@ export function init(RuntimeName, PHPLoader) { function successCallback() { runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -17977,11 +17969,8 @@ export function init(RuntimeName, PHPLoader) { var trace = getCallstack(); var parts = trace.split('\n'); for (var i = 0; i < parts.length; i++) { - var ret = (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0, + var ret = ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0, arg ); if (ret !== 0) return; @@ -18525,12 +18514,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(e.locale || '', keyEventData + 128, 32); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, keyEventData, userData ) @@ -18648,12 +18633,8 @@ export function init(RuntimeName, PHPLoader) { fillMouseEventData(JSEvents.mouseEvent, e, target); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.mouseEvent, userData ) @@ -18867,12 +18848,8 @@ export function init(RuntimeName, PHPLoader) { HEAPF64[(wheelEvent + 80) >> 3] = e['deltaZ']; HEAP32[(wheelEvent + 88) >> 2] = e['deltaMode']; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, wheelEvent, userData ) @@ -18953,12 +18930,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(uiEvent + 28) >> 2] = pageXOffset | 0; // scroll offsets are float HEAP32[(uiEvent + 32) >> 2] = pageYOffset | 0; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, uiEvent, userData ) @@ -19032,12 +19005,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(id, focusEvent + 128, 128); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, focusEvent, userData ) @@ -19153,12 +19122,8 @@ export function init(RuntimeName, PHPLoader) { ); // TODO: Thread-safety with respect to emscripten_get_deviceorientation_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceOrientationEvent, userData ) @@ -19242,12 +19207,8 @@ export function init(RuntimeName, PHPLoader) { fillDeviceMotionEventData(JSEvents.deviceMotionEvent, e, target); // TODO: Thread-safety with respect to emscripten_get_devicemotion_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceMotionEvent, userData ) @@ -19354,12 +19315,8 @@ export function init(RuntimeName, PHPLoader) { fillOrientationChangeEventData(orientationChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, orientationChangeEvent, userData ) @@ -19488,12 +19445,8 @@ export function init(RuntimeName, PHPLoader) { fillFullscreenChangeEventData(fullscreenChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, fullscreenChangeEvent, userData ) @@ -19638,12 +19591,8 @@ export function init(RuntimeName, PHPLoader) { ); if (currentFullscreenStrategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19744,12 +19693,8 @@ export function init(RuntimeName, PHPLoader) { currentFullscreenStrategy = strategy; if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19849,12 +19794,8 @@ export function init(RuntimeName, PHPLoader) { !inCenteredWithoutScalingFullscreenMode && currentFullscreenStrategy.canvasResizedCallback ) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19953,12 +19894,8 @@ export function init(RuntimeName, PHPLoader) { softFullscreenResizeWebGLRenderTarget ); if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19971,12 +19908,8 @@ export function init(RuntimeName, PHPLoader) { // Inform the caller that the canvas size has changed. if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -20038,12 +19971,8 @@ export function init(RuntimeName, PHPLoader) { fillPointerlockChangeEventData(pointerlockChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, pointerlockChangeEvent, userData ) @@ -20097,12 +20026,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var pointerlockErrorEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -20256,12 +20181,8 @@ export function init(RuntimeName, PHPLoader) { fillVisibilityChangeEventData(visibilityChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, visibilityChangeEvent, userData ) @@ -20381,12 +20302,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(touchEvent + 8) >> 2] = numTouches; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, touchEvent, userData ) @@ -20524,12 +20441,8 @@ export function init(RuntimeName, PHPLoader) { fillGamepadEventData(gamepadEvent, e['gamepad']); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, gamepadEvent, userData ) @@ -20631,12 +20544,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var beforeUnloadEventHandlerFunc = (e = event) => { // Note: This is always called on the main browser thread, since it needs synchronously return a value! - var confirmationMessage = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + var confirmationMessage = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ); @@ -20707,12 +20616,8 @@ export function init(RuntimeName, PHPLoader) { fillBatteryEventData(batteryEvent, battery); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, batteryEvent, userData ) @@ -20814,11 +20719,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame((timeStamp) => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ); @@ -20830,11 +20732,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame_loop = (cb, userData) => { function tick(timeStamp) { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ) { @@ -21091,10 +20990,8 @@ export function init(RuntimeName, PHPLoader) { return emSetImmediate(() => { runtimeKeepalivePop(); callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }); @@ -21111,10 +21008,8 @@ export function init(RuntimeName, PHPLoader) { function tick() { callUserCallback(() => { if ( - (( - a1 - ) => {}) /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ) { emSetImmediate(tick); @@ -21131,10 +21026,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_timeout = (cb, msecs, userData) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ), msecs ); @@ -21150,11 +21043,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - t, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ t, userData ) ) { @@ -21178,10 +21068,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePush(); return setInterval(() => { callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }, msecs); @@ -21196,10 +21084,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_async_call = (func, arg, millis) => { var wrapper = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); if ( @@ -21232,7 +21118,7 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_main_loop = (func, fps, simulateInfiniteLoop) => { var iterFunc = - () => {} /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */; + () => {}; /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ setMainLoop(iterFunc, fps, simulateInfiniteLoop); }; _emscripten_set_main_loop.sig = 'vpii'; @@ -21244,10 +21130,8 @@ export function init(RuntimeName, PHPLoader) { simulateInfiniteLoop ) => { var iterFunc = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); setMainLoop(iterFunc, fps, simulateInfiniteLoop, arg); }; @@ -21268,10 +21152,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21284,10 +21166,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_uncounted_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21321,12 +21201,8 @@ export function init(RuntimeName, PHPLoader) { var resultPtr = stackAlloc(POINTER_SIZE); HEAPU32[resultPtr >> 2] = 0; try { - var result = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - resultPtr, + var result = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ resultPtr, userData, value ); @@ -22163,19 +22039,15 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, true // don'tCreateFile - it's already there @@ -22209,21 +22081,16 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, cname ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, true // don'tCreateFile - it's already there @@ -22491,10 +22358,10 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => withStackSave(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stringToUTF8OnStack(_file) + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stringToUTF8OnStack( + _file + ) ) ) ); @@ -22538,12 +22405,8 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata, buffer, byteArray.length ); @@ -22553,10 +22416,8 @@ export function init(RuntimeName, PHPLoader) { if (onerror) { runtimeKeepalivePop(); callUserCallback(() => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata ); }); } @@ -22612,12 +22473,8 @@ export function init(RuntimeName, PHPLoader) { ); if (onload) { var sp = stackSave(); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, stringToUTF8OnStack(_file) ); @@ -22625,12 +22482,8 @@ export function init(RuntimeName, PHPLoader) { } } else { if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22643,12 +22496,8 @@ export function init(RuntimeName, PHPLoader) { http.onerror = (e) => { runtimeKeepalivePop(); if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22663,12 +22512,8 @@ export function init(RuntimeName, PHPLoader) { ) { var percentComplete = (e.loaded / e.total) * 100; if (onprogress) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, percentComplete ); @@ -22725,13 +22570,8 @@ export function init(RuntimeName, PHPLoader) { if (http.statusText) { statusText = stringToUTF8OnStack(http.statusText); } - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status, statusText @@ -22752,13 +22592,8 @@ export function init(RuntimeName, PHPLoader) { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); if (onload) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, buffer, byteArray.length @@ -22779,13 +22614,8 @@ export function init(RuntimeName, PHPLoader) { // PROGRESS http.onprogress = (e) => { if (onprogress) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, e.loaded, e.lengthComputable || e.lengthComputable === undefined @@ -23116,24 +22946,16 @@ export function init(RuntimeName, PHPLoader) { if (event === 'error') { withStackSave(() => { var msg = stringToUTF8OnStack(data[2]); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data[0], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data[0], data[1], msg, userData ); }); } else { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data, userData ); } @@ -24086,12 +23908,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var webGlEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -24310,21 +24128,15 @@ export function init(RuntimeName, PHPLoader) { ) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } else if (GLUT.buttons != 0 && GLUT.motionFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } @@ -24485,12 +24297,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24500,12 +24308,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24520,12 +24324,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24535,12 +24335,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24604,13 +24400,10 @@ export function init(RuntimeName, PHPLoader) { } catch (e) {} event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24625,13 +24418,10 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 1 /*GLUT_UP*/, Browser.mouseX, Browser.mouseY @@ -24660,13 +24450,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - button, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ button, 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24704,11 +24489,8 @@ export function init(RuntimeName, PHPLoader) { /* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */ if (GLUT.reshapeFunc) { // out("GLUT.reshapeFunc (from FS): " + width + ", " + height); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24764,11 +24546,8 @@ export function init(RuntimeName, PHPLoader) { // Resize callback stage 2: updateResizeListeners notifies reshapeFunc Browser.resizeListeners.push((width, height) => { if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24883,10 +24662,8 @@ export function init(RuntimeName, PHPLoader) { var _glutTimerFunc = (msec, func, value) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - value + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ value ), msec ); @@ -25046,11 +24823,8 @@ export function init(RuntimeName, PHPLoader) { Browser.setCanvasSize(width, height, true); // N.B. GLUT.reshapeFunc is also registered as a canvas resize callback. // Just call it once here. if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -26104,21 +25878,15 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, buffer, byteArray.length ); @@ -26150,18 +25918,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onstore) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); } @@ -26176,18 +25940,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (ondelete) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26204,19 +25964,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (oncheck) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, exists ); }); @@ -26232,18 +25987,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onclear) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26400,11 +26151,8 @@ export function init(RuntimeName, PHPLoader) { safeSetTimeout(() => { var stackBegin = Asyncify.currData + 12; var stackEnd = HEAPU32[Asyncify.currData >> 2]; - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stackBegin, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stackBegin, stackEnd ); wakeUp(); @@ -26453,10 +26201,8 @@ export function init(RuntimeName, PHPLoader) { HEAPU32[(newFiber + 12) >> 2] = 0; var userData = HEAPU32[(newFiber + 16) >> 2]; - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ); } else { var asyncifyData = newFiber + 20; @@ -27467,11 +27213,8 @@ export function init(RuntimeName, PHPLoader) { if (!SDL.eventHandler) return; while (SDL.pollEvent(SDL.eventHandlerTemp)) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.eventHandlerContext, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL.eventHandlerContext, SDL.eventHandlerTemp ); } @@ -29095,12 +28838,9 @@ export function init(RuntimeName, PHPLoader) { return; // Ask SDL audio data from the user code. - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.audio.userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL + .audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize ); @@ -29558,10 +29298,8 @@ export function init(RuntimeName, PHPLoader) { info.audio = null; } if (SDL.channelFinished) { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); } } @@ -29629,10 +29367,8 @@ export function init(RuntimeName, PHPLoader) { channelInfo.audio = null; } if (SDL.channelFinished) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); }; if (channelInfo.audio) { @@ -30367,11 +30103,8 @@ export function init(RuntimeName, PHPLoader) { var _SDL_AddTimer = (interval, callback, param) => safeSetTimeout( () => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - interval, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ interval, param ), interval @@ -30744,12 +30477,8 @@ export function init(RuntimeName, PHPLoader) { socket.onopen = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30771,12 +30500,8 @@ export function init(RuntimeName, PHPLoader) { socket.onerror = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30801,12 +30526,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAP8[eventPtr + 4] = e.wasClean), (HEAP16[(eventPtr + 6) >> 1] = e.code), stringToUTF8(e.reason, eventPtr + 8, 512)); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30840,12 +30561,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAPU32[(eventPtr + 4) >> 2] = buf), (HEAP32[(eventPtr + 8) >> 2] = len), (HEAP8[eventPtr + 12] = isText), - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData )); diff --git a/packages/php-wasm/node/asyncify/php_8_4.js b/packages/php-wasm/node/asyncify/php_8_4.js index fb83e11b51..05cb46aad0 100644 --- a/packages/php-wasm/node/asyncify/php_8_4.js +++ b/packages/php-wasm/node/asyncify/php_8_4.js @@ -5118,10 +5118,8 @@ export function init(RuntimeName, PHPLoader) { ); var ___call_sighandler = (fp, sig) => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - sig + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ sig ); ___call_sighandler.sig = 'vpi'; @@ -8384,11 +8382,8 @@ export function init(RuntimeName, PHPLoader) { dlSetError(`'Could not load dynamic lib: ${filename}\n${e}`); runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -8396,11 +8391,8 @@ export function init(RuntimeName, PHPLoader) { function successCallback() { runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -17977,11 +17969,8 @@ export function init(RuntimeName, PHPLoader) { var trace = getCallstack(); var parts = trace.split('\n'); for (var i = 0; i < parts.length; i++) { - var ret = (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0, + var ret = ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0, arg ); if (ret !== 0) return; @@ -18525,12 +18514,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(e.locale || '', keyEventData + 128, 32); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, keyEventData, userData ) @@ -18648,12 +18633,8 @@ export function init(RuntimeName, PHPLoader) { fillMouseEventData(JSEvents.mouseEvent, e, target); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.mouseEvent, userData ) @@ -18867,12 +18848,8 @@ export function init(RuntimeName, PHPLoader) { HEAPF64[(wheelEvent + 80) >> 3] = e['deltaZ']; HEAP32[(wheelEvent + 88) >> 2] = e['deltaMode']; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, wheelEvent, userData ) @@ -18953,12 +18930,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(uiEvent + 28) >> 2] = pageXOffset | 0; // scroll offsets are float HEAP32[(uiEvent + 32) >> 2] = pageYOffset | 0; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, uiEvent, userData ) @@ -19032,12 +19005,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(id, focusEvent + 128, 128); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, focusEvent, userData ) @@ -19153,12 +19122,8 @@ export function init(RuntimeName, PHPLoader) { ); // TODO: Thread-safety with respect to emscripten_get_deviceorientation_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceOrientationEvent, userData ) @@ -19242,12 +19207,8 @@ export function init(RuntimeName, PHPLoader) { fillDeviceMotionEventData(JSEvents.deviceMotionEvent, e, target); // TODO: Thread-safety with respect to emscripten_get_devicemotion_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceMotionEvent, userData ) @@ -19354,12 +19315,8 @@ export function init(RuntimeName, PHPLoader) { fillOrientationChangeEventData(orientationChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, orientationChangeEvent, userData ) @@ -19488,12 +19445,8 @@ export function init(RuntimeName, PHPLoader) { fillFullscreenChangeEventData(fullscreenChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, fullscreenChangeEvent, userData ) @@ -19638,12 +19591,8 @@ export function init(RuntimeName, PHPLoader) { ); if (currentFullscreenStrategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19744,12 +19693,8 @@ export function init(RuntimeName, PHPLoader) { currentFullscreenStrategy = strategy; if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19849,12 +19794,8 @@ export function init(RuntimeName, PHPLoader) { !inCenteredWithoutScalingFullscreenMode && currentFullscreenStrategy.canvasResizedCallback ) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19953,12 +19894,8 @@ export function init(RuntimeName, PHPLoader) { softFullscreenResizeWebGLRenderTarget ); if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19971,12 +19908,8 @@ export function init(RuntimeName, PHPLoader) { // Inform the caller that the canvas size has changed. if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -20038,12 +19971,8 @@ export function init(RuntimeName, PHPLoader) { fillPointerlockChangeEventData(pointerlockChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, pointerlockChangeEvent, userData ) @@ -20097,12 +20026,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var pointerlockErrorEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -20256,12 +20181,8 @@ export function init(RuntimeName, PHPLoader) { fillVisibilityChangeEventData(visibilityChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, visibilityChangeEvent, userData ) @@ -20381,12 +20302,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(touchEvent + 8) >> 2] = numTouches; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, touchEvent, userData ) @@ -20524,12 +20441,8 @@ export function init(RuntimeName, PHPLoader) { fillGamepadEventData(gamepadEvent, e['gamepad']); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, gamepadEvent, userData ) @@ -20631,12 +20544,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var beforeUnloadEventHandlerFunc = (e = event) => { // Note: This is always called on the main browser thread, since it needs synchronously return a value! - var confirmationMessage = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + var confirmationMessage = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ); @@ -20707,12 +20616,8 @@ export function init(RuntimeName, PHPLoader) { fillBatteryEventData(batteryEvent, battery); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, batteryEvent, userData ) @@ -20814,11 +20719,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame((timeStamp) => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ); @@ -20830,11 +20732,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame_loop = (cb, userData) => { function tick(timeStamp) { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ) { @@ -21091,10 +20990,8 @@ export function init(RuntimeName, PHPLoader) { return emSetImmediate(() => { runtimeKeepalivePop(); callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }); @@ -21111,10 +21008,8 @@ export function init(RuntimeName, PHPLoader) { function tick() { callUserCallback(() => { if ( - (( - a1 - ) => {}) /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ) { emSetImmediate(tick); @@ -21131,10 +21026,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_timeout = (cb, msecs, userData) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ), msecs ); @@ -21150,11 +21043,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - t, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ t, userData ) ) { @@ -21178,10 +21068,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePush(); return setInterval(() => { callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }, msecs); @@ -21196,10 +21084,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_async_call = (func, arg, millis) => { var wrapper = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); if ( @@ -21232,7 +21118,7 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_main_loop = (func, fps, simulateInfiniteLoop) => { var iterFunc = - () => {} /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */; + () => {}; /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ setMainLoop(iterFunc, fps, simulateInfiniteLoop); }; _emscripten_set_main_loop.sig = 'vpii'; @@ -21244,10 +21130,8 @@ export function init(RuntimeName, PHPLoader) { simulateInfiniteLoop ) => { var iterFunc = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); setMainLoop(iterFunc, fps, simulateInfiniteLoop, arg); }; @@ -21268,10 +21152,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21284,10 +21166,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_uncounted_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21321,12 +21201,8 @@ export function init(RuntimeName, PHPLoader) { var resultPtr = stackAlloc(POINTER_SIZE); HEAPU32[resultPtr >> 2] = 0; try { - var result = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - resultPtr, + var result = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ resultPtr, userData, value ); @@ -22163,19 +22039,15 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, true // don'tCreateFile - it's already there @@ -22209,21 +22081,16 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, cname ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, true // don'tCreateFile - it's already there @@ -22491,10 +22358,10 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => withStackSave(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stringToUTF8OnStack(_file) + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stringToUTF8OnStack( + _file + ) ) ) ); @@ -22538,12 +22405,8 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata, buffer, byteArray.length ); @@ -22553,10 +22416,8 @@ export function init(RuntimeName, PHPLoader) { if (onerror) { runtimeKeepalivePop(); callUserCallback(() => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata ); }); } @@ -22612,12 +22473,8 @@ export function init(RuntimeName, PHPLoader) { ); if (onload) { var sp = stackSave(); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, stringToUTF8OnStack(_file) ); @@ -22625,12 +22482,8 @@ export function init(RuntimeName, PHPLoader) { } } else { if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22643,12 +22496,8 @@ export function init(RuntimeName, PHPLoader) { http.onerror = (e) => { runtimeKeepalivePop(); if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22663,12 +22512,8 @@ export function init(RuntimeName, PHPLoader) { ) { var percentComplete = (e.loaded / e.total) * 100; if (onprogress) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, percentComplete ); @@ -22725,13 +22570,8 @@ export function init(RuntimeName, PHPLoader) { if (http.statusText) { statusText = stringToUTF8OnStack(http.statusText); } - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status, statusText @@ -22752,13 +22592,8 @@ export function init(RuntimeName, PHPLoader) { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); if (onload) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, buffer, byteArray.length @@ -22779,13 +22614,8 @@ export function init(RuntimeName, PHPLoader) { // PROGRESS http.onprogress = (e) => { if (onprogress) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, e.loaded, e.lengthComputable || e.lengthComputable === undefined @@ -23116,24 +22946,16 @@ export function init(RuntimeName, PHPLoader) { if (event === 'error') { withStackSave(() => { var msg = stringToUTF8OnStack(data[2]); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data[0], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data[0], data[1], msg, userData ); }); } else { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data, userData ); } @@ -24086,12 +23908,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var webGlEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -24310,21 +24128,15 @@ export function init(RuntimeName, PHPLoader) { ) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } else if (GLUT.buttons != 0 && GLUT.motionFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } @@ -24485,12 +24297,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24500,12 +24308,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24520,12 +24324,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24535,12 +24335,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24604,13 +24400,10 @@ export function init(RuntimeName, PHPLoader) { } catch (e) {} event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24625,13 +24418,10 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 1 /*GLUT_UP*/, Browser.mouseX, Browser.mouseY @@ -24660,13 +24450,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - button, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ button, 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24704,11 +24489,8 @@ export function init(RuntimeName, PHPLoader) { /* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */ if (GLUT.reshapeFunc) { // out("GLUT.reshapeFunc (from FS): " + width + ", " + height); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24764,11 +24546,8 @@ export function init(RuntimeName, PHPLoader) { // Resize callback stage 2: updateResizeListeners notifies reshapeFunc Browser.resizeListeners.push((width, height) => { if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24883,10 +24662,8 @@ export function init(RuntimeName, PHPLoader) { var _glutTimerFunc = (msec, func, value) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - value + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ value ), msec ); @@ -25046,11 +24823,8 @@ export function init(RuntimeName, PHPLoader) { Browser.setCanvasSize(width, height, true); // N.B. GLUT.reshapeFunc is also registered as a canvas resize callback. // Just call it once here. if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -26104,21 +25878,15 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, buffer, byteArray.length ); @@ -26150,18 +25918,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onstore) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); } @@ -26176,18 +25940,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (ondelete) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26204,19 +25964,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (oncheck) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, exists ); }); @@ -26232,18 +25987,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onclear) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26400,11 +26151,8 @@ export function init(RuntimeName, PHPLoader) { safeSetTimeout(() => { var stackBegin = Asyncify.currData + 12; var stackEnd = HEAPU32[Asyncify.currData >> 2]; - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stackBegin, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stackBegin, stackEnd ); wakeUp(); @@ -26453,10 +26201,8 @@ export function init(RuntimeName, PHPLoader) { HEAPU32[(newFiber + 12) >> 2] = 0; var userData = HEAPU32[(newFiber + 16) >> 2]; - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ); } else { var asyncifyData = newFiber + 20; @@ -27467,11 +27213,8 @@ export function init(RuntimeName, PHPLoader) { if (!SDL.eventHandler) return; while (SDL.pollEvent(SDL.eventHandlerTemp)) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.eventHandlerContext, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL.eventHandlerContext, SDL.eventHandlerTemp ); } @@ -29095,12 +28838,9 @@ export function init(RuntimeName, PHPLoader) { return; // Ask SDL audio data from the user code. - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.audio.userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL + .audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize ); @@ -29558,10 +29298,8 @@ export function init(RuntimeName, PHPLoader) { info.audio = null; } if (SDL.channelFinished) { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); } } @@ -29629,10 +29367,8 @@ export function init(RuntimeName, PHPLoader) { channelInfo.audio = null; } if (SDL.channelFinished) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); }; if (channelInfo.audio) { @@ -30367,11 +30103,8 @@ export function init(RuntimeName, PHPLoader) { var _SDL_AddTimer = (interval, callback, param) => safeSetTimeout( () => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - interval, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ interval, param ), interval @@ -30744,12 +30477,8 @@ export function init(RuntimeName, PHPLoader) { socket.onopen = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30771,12 +30500,8 @@ export function init(RuntimeName, PHPLoader) { socket.onerror = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30801,12 +30526,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAP8[eventPtr + 4] = e.wasClean), (HEAP16[(eventPtr + 6) >> 1] = e.code), stringToUTF8(e.reason, eventPtr + 8, 512)); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30840,12 +30561,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAPU32[(eventPtr + 4) >> 2] = buf), (HEAP32[(eventPtr + 8) >> 2] = len), (HEAP8[eventPtr + 12] = isText), - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData )); diff --git a/packages/php-wasm/node/asyncify/php_8_5.js b/packages/php-wasm/node/asyncify/php_8_5.js index 0fb817bb9a..a9fc6ebbab 100644 --- a/packages/php-wasm/node/asyncify/php_8_5.js +++ b/packages/php-wasm/node/asyncify/php_8_5.js @@ -5118,10 +5118,8 @@ export function init(RuntimeName, PHPLoader) { ); var ___call_sighandler = (fp, sig) => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - sig + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ sig ); ___call_sighandler.sig = 'vpi'; @@ -8384,11 +8382,8 @@ export function init(RuntimeName, PHPLoader) { dlSetError(`'Could not load dynamic lib: ${filename}\n${e}`); runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -8396,11 +8391,8 @@ export function init(RuntimeName, PHPLoader) { function successCallback() { runtimeKeepalivePop(); callUserCallback(() => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, user_data ) ); @@ -17977,11 +17969,8 @@ export function init(RuntimeName, PHPLoader) { var trace = getCallstack(); var parts = trace.split('\n'); for (var i = 0; i < parts.length; i++) { - var ret = (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0, + var ret = ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0, arg ); if (ret !== 0) return; @@ -18525,12 +18514,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(e.locale || '', keyEventData + 128, 32); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, keyEventData, userData ) @@ -18648,12 +18633,8 @@ export function init(RuntimeName, PHPLoader) { fillMouseEventData(JSEvents.mouseEvent, e, target); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.mouseEvent, userData ) @@ -18867,12 +18848,8 @@ export function init(RuntimeName, PHPLoader) { HEAPF64[(wheelEvent + 80) >> 3] = e['deltaZ']; HEAP32[(wheelEvent + 88) >> 2] = e['deltaMode']; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, wheelEvent, userData ) @@ -18953,12 +18930,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(uiEvent + 28) >> 2] = pageXOffset | 0; // scroll offsets are float HEAP32[(uiEvent + 32) >> 2] = pageYOffset | 0; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, uiEvent, userData ) @@ -19032,12 +19005,8 @@ export function init(RuntimeName, PHPLoader) { stringToUTF8(id, focusEvent + 128, 128); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, focusEvent, userData ) @@ -19153,12 +19122,8 @@ export function init(RuntimeName, PHPLoader) { ); // TODO: Thread-safety with respect to emscripten_get_deviceorientation_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceOrientationEvent, userData ) @@ -19242,12 +19207,8 @@ export function init(RuntimeName, PHPLoader) { fillDeviceMotionEventData(JSEvents.deviceMotionEvent, e, target); // TODO: Thread-safety with respect to emscripten_get_devicemotion_status() if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, JSEvents.deviceMotionEvent, userData ) @@ -19354,12 +19315,8 @@ export function init(RuntimeName, PHPLoader) { fillOrientationChangeEventData(orientationChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, orientationChangeEvent, userData ) @@ -19488,12 +19445,8 @@ export function init(RuntimeName, PHPLoader) { fillFullscreenChangeEventData(fullscreenChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, fullscreenChangeEvent, userData ) @@ -19638,12 +19591,8 @@ export function init(RuntimeName, PHPLoader) { ); if (currentFullscreenStrategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19744,12 +19693,8 @@ export function init(RuntimeName, PHPLoader) { currentFullscreenStrategy = strategy; if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19849,12 +19794,8 @@ export function init(RuntimeName, PHPLoader) { !inCenteredWithoutScalingFullscreenMode && currentFullscreenStrategy.canvasResizedCallback ) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData ); @@ -19953,12 +19894,8 @@ export function init(RuntimeName, PHPLoader) { softFullscreenResizeWebGLRenderTarget ); if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -19971,12 +19908,8 @@ export function init(RuntimeName, PHPLoader) { // Inform the caller that the canvas size has changed. if (strategy.canvasResizedCallback) { - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 37, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 37, 0, strategy.canvasResizedCallbackUserData ); @@ -20038,12 +19971,8 @@ export function init(RuntimeName, PHPLoader) { fillPointerlockChangeEventData(pointerlockChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, pointerlockChangeEvent, userData ) @@ -20097,12 +20026,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var pointerlockErrorEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -20256,12 +20181,8 @@ export function init(RuntimeName, PHPLoader) { fillVisibilityChangeEventData(visibilityChangeEvent); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, visibilityChangeEvent, userData ) @@ -20381,12 +20302,8 @@ export function init(RuntimeName, PHPLoader) { HEAP32[(touchEvent + 8) >> 2] = numTouches; if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, touchEvent, userData ) @@ -20524,12 +20441,8 @@ export function init(RuntimeName, PHPLoader) { fillGamepadEventData(gamepadEvent, e['gamepad']); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, gamepadEvent, userData ) @@ -20631,12 +20544,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var beforeUnloadEventHandlerFunc = (e = event) => { // Note: This is always called on the main browser thread, since it needs synchronously return a value! - var confirmationMessage = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + var confirmationMessage = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ); @@ -20707,12 +20616,8 @@ export function init(RuntimeName, PHPLoader) { fillBatteryEventData(batteryEvent, battery); if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, batteryEvent, userData ) @@ -20814,11 +20719,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame = (cb, userData) => requestAnimationFrame((timeStamp) => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ); @@ -20830,11 +20732,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_request_animation_frame_loop = (cb, userData) => { function tick(timeStamp) { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - timeStamp, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ timeStamp, userData ) ) { @@ -21091,10 +20990,8 @@ export function init(RuntimeName, PHPLoader) { return emSetImmediate(() => { runtimeKeepalivePop(); callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }); @@ -21111,10 +21008,8 @@ export function init(RuntimeName, PHPLoader) { function tick() { callUserCallback(() => { if ( - (( - a1 - ) => {}) /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature ii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ) { emSetImmediate(tick); @@ -21131,10 +21026,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_timeout = (cb, msecs, userData) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ), msecs ); @@ -21150,11 +21043,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => { if ( - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - t, + ((a1, a2) => {})( + /* a dynamic function call to signature idi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ t, userData ) ) { @@ -21178,10 +21068,8 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePush(); return setInterval(() => { callUserCallback(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ) ); }, msecs); @@ -21196,10 +21084,8 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_async_call = (func, arg, millis) => { var wrapper = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); if ( @@ -21232,7 +21118,7 @@ export function init(RuntimeName, PHPLoader) { var _emscripten_set_main_loop = (func, fps, simulateInfiniteLoop) => { var iterFunc = - () => {} /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */; + () => {}; /* a dynamic function call to signature v, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ setMainLoop(iterFunc, fps, simulateInfiniteLoop); }; _emscripten_set_main_loop.sig = 'vpii'; @@ -21244,10 +21130,8 @@ export function init(RuntimeName, PHPLoader) { simulateInfiniteLoop ) => { var iterFunc = () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); setMainLoop(iterFunc, fps, simulateInfiniteLoop, arg); }; @@ -21268,10 +21152,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21284,10 +21166,8 @@ export function init(RuntimeName, PHPLoader) { var __emscripten_push_uncounted_main_loop_blocker = (func, arg, name) => { MainLoop.queue.push({ func: () => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, name: UTF8ToString(name), @@ -21321,12 +21201,8 @@ export function init(RuntimeName, PHPLoader) { var resultPtr = stackAlloc(POINTER_SIZE); HEAPU32[resultPtr >> 2] = 0; try { - var result = (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - resultPtr, + var result = ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ resultPtr, userData, value ); @@ -22163,19 +22039,15 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - file + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ file ); }, true // don'tCreateFile - it's already there @@ -22209,21 +22081,16 @@ export function init(RuntimeName, PHPLoader) { () => { runtimeKeepalivePop(); if (onload) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, cname ); }, () => { runtimeKeepalivePop(); if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }, true // don'tCreateFile - it's already there @@ -22491,10 +22358,10 @@ export function init(RuntimeName, PHPLoader) { runtimeKeepalivePop(); callUserCallback(() => withStackSave(() => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stringToUTF8OnStack(_file) + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stringToUTF8OnStack( + _file + ) ) ) ); @@ -22538,12 +22405,8 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata, buffer, byteArray.length ); @@ -22553,10 +22416,8 @@ export function init(RuntimeName, PHPLoader) { if (onerror) { runtimeKeepalivePop(); callUserCallback(() => { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userdata + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userdata ); }); } @@ -22612,12 +22473,8 @@ export function init(RuntimeName, PHPLoader) { ); if (onload) { var sp = stackSave(); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, stringToUTF8OnStack(_file) ); @@ -22625,12 +22482,8 @@ export function init(RuntimeName, PHPLoader) { } } else { if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22643,12 +22496,8 @@ export function init(RuntimeName, PHPLoader) { http.onerror = (e) => { runtimeKeepalivePop(); if (onerror) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status ); @@ -22663,12 +22512,8 @@ export function init(RuntimeName, PHPLoader) { ) { var percentComplete = (e.loaded / e.total) * 100; if (onprogress) - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, percentComplete ); @@ -22725,13 +22570,8 @@ export function init(RuntimeName, PHPLoader) { if (http.statusText) { statusText = stringToUTF8OnStack(http.statusText); } - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, http.status, statusText @@ -22752,13 +22592,8 @@ export function init(RuntimeName, PHPLoader) { var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); if (onload) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, buffer, byteArray.length @@ -22779,13 +22614,8 @@ export function init(RuntimeName, PHPLoader) { // PROGRESS http.onprogress = (e) => { if (onprogress) - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - handle, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ handle, userdata, e.loaded, e.lengthComputable || e.lengthComputable === undefined @@ -23116,24 +22946,16 @@ export function init(RuntimeName, PHPLoader) { if (event === 'error') { withStackSave(() => { var msg = stringToUTF8OnStack(data[2]); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data[0], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data[0], data[1], msg, userData ); }); } else { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - data, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ data, userData ); } @@ -24086,12 +23908,8 @@ export function init(RuntimeName, PHPLoader) { ) => { var webGlEventHandlerFunc = (e = event) => { if ( - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - eventTypeId, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ eventTypeId, 0, userData ) @@ -24310,21 +24128,15 @@ export function init(RuntimeName, PHPLoader) { ) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } else if (GLUT.buttons != 0 && GLUT.motionFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - lastX, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ lastX, lastY ); } @@ -24485,12 +24297,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24500,12 +24308,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24520,12 +24324,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.specialUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24535,12 +24335,8 @@ export function init(RuntimeName, PHPLoader) { if (key !== null && GLUT.keyboardUpFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - key, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ key, Browser.mouseX, Browser.mouseY ); @@ -24604,13 +24400,10 @@ export function init(RuntimeName, PHPLoader) { } catch (e) {} event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24625,13 +24418,10 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - event['button'], + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ event[ + 'button' + ], 1 /*GLUT_UP*/, Browser.mouseX, Browser.mouseY @@ -24660,13 +24450,8 @@ export function init(RuntimeName, PHPLoader) { if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); - (( - a1, - a2, - a3, - a4 - ) => {}) /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - button, + ((a1, a2, a3, a4) => {})( + /* a dynamic function call to signature viiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ button, 0 /*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY @@ -24704,11 +24489,8 @@ export function init(RuntimeName, PHPLoader) { /* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */ if (GLUT.reshapeFunc) { // out("GLUT.reshapeFunc (from FS): " + width + ", " + height); - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24764,11 +24546,8 @@ export function init(RuntimeName, PHPLoader) { // Resize callback stage 2: updateResizeListeners notifies reshapeFunc Browser.resizeListeners.push((width, height) => { if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -24883,10 +24662,8 @@ export function init(RuntimeName, PHPLoader) { var _glutTimerFunc = (msec, func, value) => safeSetTimeout( () => - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - value + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ value ), msec ); @@ -25046,11 +24823,8 @@ export function init(RuntimeName, PHPLoader) { Browser.setCanvasSize(width, height, true); // N.B. GLUT.reshapeFunc is also registered as a canvas resize callback. // Just call it once here. if (GLUT.reshapeFunc) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - width, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ width, height ); } @@ -26104,21 +25878,15 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } var buffer = _malloc(byteArray.length); HEAPU8.set(byteArray, buffer); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, buffer, byteArray.length ); @@ -26150,18 +25918,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onstore) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); } @@ -26176,18 +25940,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (ondelete) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26204,19 +25964,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (oncheck) - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg, exists ); }); @@ -26232,18 +25987,14 @@ export function init(RuntimeName, PHPLoader) { callUserCallback(() => { if (error) { if (onerror) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); return; } if (onclear) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - arg + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ arg ); }); }); @@ -26400,11 +26151,8 @@ export function init(RuntimeName, PHPLoader) { safeSetTimeout(() => { var stackBegin = Asyncify.currData + 12; var stackEnd = HEAPU32[Asyncify.currData >> 2]; - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - stackBegin, + ((a1, a2) => {})( + /* a dynamic function call to signature vii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ stackBegin, stackEnd ); wakeUp(); @@ -26453,10 +26201,8 @@ export function init(RuntimeName, PHPLoader) { HEAPU32[(newFiber + 12) >> 2] = 0; var userData = HEAPU32[(newFiber + 16) >> 2]; - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - userData + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ userData ); } else { var asyncifyData = newFiber + 20; @@ -27467,11 +27213,8 @@ export function init(RuntimeName, PHPLoader) { if (!SDL.eventHandler) return; while (SDL.pollEvent(SDL.eventHandlerTemp)) { - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.eventHandlerContext, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL.eventHandlerContext, SDL.eventHandlerTemp ); } @@ -29095,12 +28838,9 @@ export function init(RuntimeName, PHPLoader) { return; // Ask SDL audio data from the user code. - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - SDL.audio.userdata, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature viii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ SDL + .audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize ); @@ -29558,10 +29298,8 @@ export function init(RuntimeName, PHPLoader) { info.audio = null; } if (SDL.channelFinished) { - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); } } @@ -29629,10 +29367,8 @@ export function init(RuntimeName, PHPLoader) { channelInfo.audio = null; } if (SDL.channelFinished) - (( - a1 - ) => {}) /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - channel + ((a1) => {})( + /* a dynamic function call to signature vi, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ channel ); }; if (channelInfo.audio) { @@ -30367,11 +30103,8 @@ export function init(RuntimeName, PHPLoader) { var _SDL_AddTimer = (interval, callback, param) => safeSetTimeout( () => - (( - a1, - a2 - ) => {}) /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - interval, + ((a1, a2) => {})( + /* a dynamic function call to signature iii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ interval, param ), interval @@ -30744,12 +30477,8 @@ export function init(RuntimeName, PHPLoader) { socket.onopen = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30771,12 +30500,8 @@ export function init(RuntimeName, PHPLoader) { socket.onerror = function (e) { var eventPtr = WS.getSocketEvent(socketId); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30801,12 +30526,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAP8[eventPtr + 4] = e.wasClean), (HEAP16[(eventPtr + 6) >> 1] = e.code), stringToUTF8(e.reason, eventPtr + 8, 512)); - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData ); @@ -30840,12 +30561,8 @@ export function init(RuntimeName, PHPLoader) { ((HEAPU32[(eventPtr + 4) >> 2] = buf), (HEAP32[(eventPtr + 8) >> 2] = len), (HEAP8[eventPtr + 12] = isText), - (( - a1, - a2, - a3 - ) => {}) /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */( - 0 /*TODO*/, + ((a1, a2, a3) => {})( + /* a dynamic function call to signature iiii, but there are no exported function pointers with that signature, so this path should never be taken. Build with ASSERTIONS enabled to validate. */ 0 /*TODO*/, eventPtr, userData )); diff --git a/packages/php-wasm/node/project.json b/packages/php-wasm/node/project.json index 0a11dbc7bf..6ccf3b364f 100644 --- a/packages/php-wasm/node/project.json +++ b/packages/php-wasm/node/project.json @@ -172,7 +172,8 @@ "reportsDirectory": "../../../coverage/packages/php-wasm/node", "testFiles": [ "php-file-locking.spec.ts", - "file-lock-manager-for-node.spec.ts", + "file-lock-manager-for-posix.spec.ts", + "file-lock-manager-for-windows.spec.ts", "php-imagick.spec.ts", "php-soap.spec.ts", "php-image-extensions.spec.ts", @@ -188,7 +189,8 @@ "reportsDirectory": "../../../coverage/packages/php-wasm/node", "testFiles": [ "php-file-locking.spec.ts", - "file-lock-manager-for-node.spec.ts", + "file-lock-manager-for-posix.spec.ts", + "file-lock-manager-for-windows.spec.ts", "php-imagick.spec.ts", "php-soap.spec.ts", "php-image-extensions.spec.ts", diff --git a/packages/php-wasm/node/src/lib/file-lock-manager-for-posix.ts b/packages/php-wasm/node/src/lib/file-lock-manager-for-posix.ts new file mode 100644 index 0000000000..d20a8d9875 --- /dev/null +++ b/packages/php-wasm/node/src/lib/file-lock-manager-for-posix.ts @@ -0,0 +1,197 @@ +import type { + FileLockManager, + WholeFileLockOp, + RequestedRangeLock, + Pid, + Fd, + Path, +} from '@php-wasm/universal'; +import { MAX_ADDRESSABLE_FILE_OFFSET } from '@php-wasm/universal'; +import { constants, fcntlSync, flockSync } from 'fs-ext-extra-prebuilt'; + +export class FileLockManagerForPosix implements FileLockManager { + // TODO: Move path of whole file lock into leaf. It is never used for lookup. + wholeFileLockMap = new Map>>(); + rangeLockedFds = new Map>>(); + + lockWholeFile(path: string, op: WholeFileLockOp): boolean { + const opType = + op.type === 'unlock' + ? 'un' + : op.waitForLock + ? op.type === 'exclusive' + ? 'ex' + : 'sh' + : op.type === 'exclusive' + ? 'exnb' + : 'shnb'; + + try { + flockSync(op.fd, opType); + + // Remember lock so we can release them + // when the process exits or the file descriptor is closed. + if (op.type === 'unlock') { + this.wholeFileLockMap.get(path)?.get(op.pid)?.delete(op.fd); + } else { + if (!this.wholeFileLockMap.has(path)) { + this.wholeFileLockMap.set(path, new Map()); + } + if (!this.wholeFileLockMap.get(path)!.has(op.pid)) { + this.wholeFileLockMap.get(path)!.set(op.pid, new Map()); + } + this.wholeFileLockMap.get(path)!.get(op.pid)!.set(op.fd, op); + } + + return true; + } catch { + // TODO: Catch and report errors unrelated to flock() denials. + return false; + } + } + + lockFileByteRange( + path: string, + op: RequestedRangeLock, + waitForLock: boolean + ): boolean { + if (op.start === op.end) { + /* + * Treat a range with zero length as covering the entire remaining range. + * POSIX Ref: https://pubs.opengroup.org/onlinepubs/9799919799/functions/fcntl.html + * "A lock shall be set to extend to the largest possible value of the file offset + * for that file by setting l_len to 0." + */ + op = { + ...op, + end: MAX_ADDRESSABLE_FILE_OFFSET, + }; + } + + const fcntlCmd = waitForLock ? 'setlkw' : 'setlk'; + const fcntlOp = + op.type === 'unlocked' + ? constants.F_UNLCK + : op.type === 'exclusive' + ? constants.F_WRLCK + : constants.F_RDLCK; + + try { + // TODO: Fix this API to take bigint for start and end. Possible optionally. + fcntlSync( + op.fd, + fcntlCmd, + fcntlOp, + Number(op.start), + Number(op.end - op.start) + ); + + // Remember that we have seen range locks for this PID and FD. + // It should be enough to release all locks with a single fcntl() call + // to unlock the entire file range when the FD is closed or the process exits. + if (!this.rangeLockedFds.has(op.pid)) { + this.rangeLockedFds.set(op.pid, new Map()); + } + const pidMap = this.rangeLockedFds.get(op.pid)!; + if (!pidMap.has(path)) { + pidMap.set(path, new Set()); + } + pidMap.get(path)!.add(op.fd); + + return true; + } catch { + // TODO: Catch and report errors unrelated to fcntl() denials. + return false; + } + } + + findFirstConflictingByteRangeLock( + path: string, + op: RequestedRangeLock + ): ReturnType { + if (op.type === 'unlocked') { + return undefined; + } + + // With fs-ext's current fcntl() implementation, + // we cannot query existing locks properly with F_GETLK. + // It only returns whether the F_GETLK command failed or not, + // and AFAIK, an F_GETLK can succeed whether there is a conflicting lock or not. + // We can fix this in our fs-ext fork, + // but for now, let just try to lock the requested range. + const obtainedLock = this.lockFileByteRange(path, op, false); + if (obtainedLock) { + this.lockFileByteRange(path, { ...op, type: 'unlocked' }, true); + return undefined; + } + + // Since we cannot obtain a lock, assume there is a conflicting lock. + // Since we query what lock conflicts + // until our fs-ext fork fixes that, let's report that the entire range is locked. + return { + type: 'exclusive', + start: 0n, + end: 0xffffffff_ffffffffn, + pid: -1, + }; + } + + releaseLocksForProcess(targetPid: number): void { + for (const [path, pidMap] of this.wholeFileLockMap.entries()) { + const fdMap = pidMap.get(targetPid); + if (!fdMap) { + continue; + } + + for (const op of fdMap.values()) { + // TODO: Log any errors. + // TODO: Does a failure here justify throwing an error (and conceding total brokenness)? + this.lockWholeFile(path, { ...op, type: 'unlock' }); + } + + pidMap.delete(targetPid); + } + + for (const [path, fdSet] of this.rangeLockedFds.get(targetPid) ?? []) { + for (const fd of fdSet) { + /* + * fcntl() lets us request to unlock the entire byte range for this process, + * so we do that instead of tracking and unlocking specific ranges. + * NOTE: Actually, the native OS is not aware of the php-wasm process ID, + * but since we track which FDs are associated with each process, + * we can simply unlock for all FDs associated with the php-wasm process. + */ + this.lockFileByteRange( + path, + { + pid: targetPid, + fd, + type: 'unlocked', + start: 0n, + end: MAX_ADDRESSABLE_FILE_OFFSET, + }, + false + ); + } + } + this.rangeLockedFds.delete(targetPid); + } + + releaseLocksOnFdClose( + targetPid: number, + targetFd: number, + targetPath: string + ): void { + // Do nothing because the native OS is responsible for releasing + // whole-file locks when the FD is closed. + + this.wholeFileLockMap.get(targetPath)?.get(targetPid)?.delete(targetFd); + + // TODO: Once we implement proper ranged fcntl()-based locks, + // release all locks for the given PID and path when the FD is closed. + // fcntl()-based locks are released whenever any file descriptor for the + // target file is closed, regardless of which FD was used to obtain the lock. + + this.rangeLockedFds.get(targetPid)?.delete(targetPath); + } +} diff --git a/packages/php-wasm/node/src/lib/file-lock-manager-for-windows.ts b/packages/php-wasm/node/src/lib/file-lock-manager-for-windows.ts new file mode 100644 index 0000000000..2f239ead88 --- /dev/null +++ b/packages/php-wasm/node/src/lib/file-lock-manager-for-windows.ts @@ -0,0 +1,429 @@ +// TODO: Add these types to the fs-ext-extra-prebuilt package. +import { + lockFileExSync, + unlockFileExSync, + constants, +} from 'fs-ext-extra-prebuilt'; +import { logger } from '@php-wasm/logger'; +import type { + FileLockManager, + WholeFileLockOp, + RequestedRangeLock, + Pid, + Fd, + Path, +} from '@php-wasm/universal'; +import { + FileLockIntervalTree, + MAX_ADDRESSABLE_FILE_OFFSET, +} from '@php-wasm/universal'; + +function toLowAndHigh32BitNumbers(num: bigint): [number, number] { + const low = Number(num & 0xffffffffn); + const high = Number((num >> 32n) & 0xffffffffn); + return [low, high]; +} + +function tryLockFileExSync( + fd: number, + flags: number, + start: bigint, + end: bigint +): boolean { + const [offsetLow, offsetHigh] = toLowAndHigh32BitNumbers(start); + const [lengthLow, lengthHigh] = toLowAndHigh32BitNumbers(end - start); + try { + lockFileExSync(fd, flags, offsetLow, offsetHigh, lengthLow, lengthHigh); + return true; + } catch { + // TODO: Rethrow if not an errno error + return false; + } +} + +function tryUnlockFileExSync(fd: number, start: bigint, end: bigint): boolean { + const [offsetLow, offsetHigh] = toLowAndHigh32BitNumbers(start); + const [lengthLow, lengthHigh] = toLowAndHigh32BitNumbers(end - start); + try { + unlockFileExSync(fd, offsetLow, offsetHigh, lengthLow, lengthHigh); + return true; + } catch { + // TODO: Rethrow if not an errno error + return false; + } +} + +export class FileLockManagerForWindows implements FileLockManager { + // TODO: Move path of whole file lock into leaf. It is never used for lookup. + wholeFileLockMap = new Map>>(); + rangeLockedFds = new Map(); + + lockWholeFile(path: string, op: WholeFileLockOp): boolean { + // For whole-file locks, we address the entire byte range of the file. + // TODO: Consider converting the exposed Win API to just use bigint for offset and length. + const start = 0n; + const end = 2n ** 64n - 1n; + + if (op.type === 'unlock') { + // TODO: Should we skip unlocking if we do not have record of the lock? + + // TODO: Catch errors + const success = tryUnlockFileExSync(op.fd, start, end); + + if (success) { + this.wholeFileLockMap.get(path)?.get(op.pid)?.delete(op.fd); + if (this.wholeFileLockMap.get(path)?.get(op.pid)?.size === 0) { + this.wholeFileLockMap.get(path)?.delete(op.pid); + } + if (this.wholeFileLockMap.get(path)?.size === 0) { + this.wholeFileLockMap.delete(path); + } + } + + // TODO: Else if unlock failed in Windows, probably log an error. + return success; + } + + const preexistingLock = this.wholeFileLockMap + .get(path) + ?.get(op.pid) + ?.get(op.fd); + if (op.type === preexistingLock?.type) { + // There is nothing to do. + return true; + } + + let flags = 0; + if (!op.waitForLock) { + flags |= constants.LOCKFILE_FAIL_IMMEDIATELY; + } + + let success = false; + if (op.type === 'shared') { + // TODO: Do we need to do anything to check for ERROR_IO_PENDING errors? + /** + * Since we are requesting a shared lock, we can obtain it first + * even if we already hold the exclusive lock. + * + * "Shared locks can overlap a locked region provided locks held + * on that region are shared locks. A shared lock can overlap an + * exclusive lock if both locks were created using the same file handle." + * @see https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-lockfileex + */ + success = tryLockFileExSync(op.fd, flags, start, end); + + if (success && preexistingLock?.type === 'exclusive') { + const exclusiveUnlockSuccess = tryUnlockFileExSync( + op.fd, + start, + end + ); + + if (exclusiveUnlockSuccess) { + // This should never happen. Log and throw an error. + const message = + 'Failed to unlock preexisting exclusive lock after failing to obtain shared lock'; + logger.error(message); + throw new Error(message); + } + } + } else if (op.type === 'exclusive') { + flags |= constants.LOCKFILE_EXCLUSIVE_LOCK; + + let sharedUnlockSuccess; + if (preexistingLock?.type === 'shared') { + sharedUnlockSuccess = tryUnlockFileExSync(op.fd, start, end); + // TODO: Log if there's an error + } + + success = tryLockFileExSync(op.fd, flags, start, end); + // TODO: Log if there's an error + + if (!success && sharedUnlockSuccess) { + /* + * We failed to obtain the exclusive lock but already + * dropped the shared lock because preexisting shared locks + * will block the exclusive lock. + * + * "If an exclusive lock is requested for a range of a file that + * already has a shared or exclusive lock, the function returns + * the error ERROR_IO_PENDING." + * @see https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-lockfileex + * + * NOTE: This actually introduces a condition where the caller of fcntl() + * does not realize it temporarily lost a shared lock. It is possible + * another party could have obtained an exclusive lock and written + * to the file by the time we are able to obtain the shared lock. + */ + const sharedReLockResult = tryLockFileExSync( + op.fd, + // Wait to restore the shared lock. + 0, + start, + end + ); + + if (!sharedReLockResult) { + // This should never happen. Log and throw an error. + const message = + 'Failed to re-lock preexisting shared lock after failing to obtain exclusive lock'; + logger.error(message); + throw new Error(message); + } + } + } else { + throw new Error(`Unexpected wholeFileLock() op: '${op.type}'`); + } + + if (success) { + if (!this.wholeFileLockMap.has(path)) { + this.wholeFileLockMap.set(path, new Map()); + } + const pidMap = this.wholeFileLockMap.get(path)!; + if (!pidMap.has(op.pid)) { + pidMap.set(op.pid, new Map()); + } + const pathMap = pidMap.get(op.pid)!; + pathMap.set(op.fd, op); + } + + return success; + } + + lockFileByteRange( + path: string, + op: RequestedRangeLock, + waitForLock: boolean + ): boolean { + if (op.start === op.end) { + /* + * Treat a range with zero length as covering the entire remaining range. + * POSIX Ref: https://pubs.opengroup.org/onlinepubs/9799919799/functions/fcntl.html + * "A lock shall be set to extend to the largest possible value of the file offset + * for that file by setting l_len to 0." + */ + op = { + ...op, + end: MAX_ADDRESSABLE_FILE_OFFSET, + }; + } + + if (!this.rangeLockedFds.has(path)) { + this.rangeLockedFds.set(path, new FileLockIntervalTree()); + } + const lockedRangeTree = this.rangeLockedFds.get(path)!; + + const overlappingLocks = lockedRangeTree.findOverlapping(op); + let preexistingLock; + if ( + overlappingLocks.length === 1 && + overlappingLocks[0].pid === op.pid && + // NOTE: FD shouldn't matter for fcntl() F_SETLK because it is a process-level lock, + // but it matters for Windows where locks are fd-specific. + overlappingLocks[0].fd === op.fd && + overlappingLocks[0].start === op.start && + overlappingLocks[0].end === op.end + ) { + preexistingLock = overlappingLocks[0]; + } + + if (op.type === preexistingLock?.type) { + // There is nothing to do. + return true; + } + + // TODO: Implement lock upgrading and downgrading like fcntl() allows? + // TODO: Implement relocking of preexisting locks like fcntl() allows? + // TODO: Implement merging locked ranges like fcntl() allows? + + let flags = 0; + if (!waitForLock) { + flags |= constants.LOCKFILE_FAIL_IMMEDIATELY; + } + // TODO: Add exception handling for Sync calls. + if (op.type === 'shared') { + const success = tryLockFileExSync(op.fd, flags, op.start, op.end); + if (!success) { + return false; + } + + if (preexistingLock?.type === 'exclusive') { + const releasedPreexistingExclusiveLock = tryUnlockFileExSync( + preexistingLock.fd, + preexistingLock.start, + preexistingLock.end + ); + if (!releasedPreexistingExclusiveLock) { + // This should never happen. Log and throw an error. + const message = + 'Failed to unlock preexisting exclusive lock after obtaining a shared lock'; + logger.error(message); + throw new Error(message); + } + } + + // TODO: Why is this a type error without `any`? Didn't we pass a shared/exclusive type guard? + lockedRangeTree.insert(op as any); + return true; + } else if (op.type === 'exclusive') { + let sharedUnlockSuccess; + if (preexistingLock?.type === 'shared') { + sharedUnlockSuccess = tryUnlockFileExSync( + op.fd, + op.start, + op.end + ); + } + + if (op.type === 'exclusive') { + flags |= constants.LOCKFILE_EXCLUSIVE_LOCK; + } + + const success = tryLockFileExSync(op.fd, flags, op.start, op.end); + if (!success) { + if (preexistingLock && sharedUnlockSuccess) { + // TODO: Explain what and why + const sharedRelockSuccess = tryLockFileExSync( + op.fd, + 0, + op.start, + op.end + ); + if (!sharedRelockSuccess) { + // This should never happen. Log and throw an error. + const message = + 'Failed to re-lock preexisting shared lock after failing to obtain exclusive lock'; + logger.error(message); + throw new Error(message); + } + } + return false; + } + + // TODO: Why is this a type error without `any`? Didn't we pass a shared/exclusive type guard? + lockedRangeTree.insert(op as any); + return true; + } else { + // TODO: Implement partial unlocking like fcntl() allows. + + // TODO: Implement range unlocks + + // TODO: Say why supporting ranged unlocks + const intersectingLocksForThisProcess = overlappingLocks + .filter((lock) => lock.pid === op.pid) + // TODO: Say why we are treating ranged locks as fd-specific + .filter((lock) => lock.fd === op.fd) + .filter((lock) => lock.start >= op.start && lock.end <= op.end); + + for (const lock of intersectingLocksForThisProcess) { + const success = tryUnlockFileExSync( + lock.fd, + lock.start, + lock.end + ); + + if (!success) { + // TODO: Why if partial unlock before failure. Should we throw? + // TODO: Report if the lock does not exist. + return false; + } + + // TODO: Report if the lock does not exist. + lockedRangeTree.remove(lock); + } + return true; + } + } + + findFirstConflictingByteRangeLock( + path: string, + op: RequestedRangeLock + ): ReturnType { + if (op.type === 'unlocked') { + return undefined; + } + + // With Windows, we cannot query existing locks, + // but we can try to lock the requested range. + const obtainedLock = this.lockFileByteRange(path, op, false); + if (obtainedLock) { + return undefined; + } + + // There is a conflicting lock. Since we cannot directly query + // what lock conflicts, let's report that the entire range is locked. + // TODO: Explain why this seems better than reporting there is an exactly conflicting lock. + this.lockFileByteRange(path, { ...op, type: 'unlocked' }, true); + return { + type: 'exclusive', + start: 0n, + end: 0xffffffff_ffffffffn, + pid: -1, + }; + } + + releaseLocksForProcess(targetPid: number): void { + for (const [path, pidMap] of this.wholeFileLockMap.entries()) { + const fdMap = pidMap.get(targetPid); + if (!fdMap) { + continue; + } + + for (const op of fdMap.values()) { + // TODO: Log any errors. + // TODO: Does a failure here justify throwing an error (and conceding total brokenness)? + this.lockWholeFile(path, { ...op, type: 'unlock' }); + } + + pidMap.delete(targetPid); + } + + for (const [path, lockedRangeTree] of this.rangeLockedFds.entries()) { + const rangesLockedByTargetPid = + lockedRangeTree.findLocksForProcess(targetPid); + for (const op of rangesLockedByTargetPid) { + // TODO: Check for errors and log them. + // TODO: Consider throwing an error if this fails. + this.lockFileByteRange( + path, + { ...op, type: 'unlocked' }, + false + ); + lockedRangeTree.remove(op); + } + } + } + + // TODO: Rename this to something clearer like releaseLockOnFileDescriptorClose + releaseLocksOnFdClose( + targetPid: number, + targetFd: number, + targetPath: string + ): void { + const wholeFileLockOp = this.wholeFileLockMap + .get(targetPath) + ?.get(targetPid) + ?.get(targetFd); + if (wholeFileLockOp) { + this.lockWholeFile(targetPath, { + ...wholeFileLockOp, + type: 'unlock', + }); + } + this.wholeFileLockMap.get(targetPath)?.get(targetPid)?.delete(targetFd); + + const lockedRangeTree = this.rangeLockedFds.get(targetPath); + for (const op of lockedRangeTree?.findLocksForProcess(targetPid) ?? + []) { + // POSIX fcntl() semantics where a lock is released + // when any FD associated with the file is closed. + // TODO: Quote spec and link to it. + this.lockFileByteRange( + targetPath, + { ...op, type: 'unlocked' }, + false + ); + lockedRangeTree!.remove(op); + } + } +} diff --git a/packages/php-wasm/node/src/lib/index.ts b/packages/php-wasm/node/src/lib/index.ts index 0cc3d1ed89..ad8bb8d936 100644 --- a/packages/php-wasm/node/src/lib/index.ts +++ b/packages/php-wasm/node/src/lib/index.ts @@ -3,5 +3,6 @@ export * from './networking/with-networking'; export * from './load-runtime'; export * from './use-host-filesystem'; export * from './node-fs-mount'; -export * from './file-lock-manager-for-node'; +export * from './file-lock-manager-for-posix'; +export * from './file-lock-manager-for-windows'; export * from './xdebug/with-xdebug'; diff --git a/packages/php-wasm/node/src/lib/load-runtime.ts b/packages/php-wasm/node/src/lib/load-runtime.ts index 9323450080..1dbdc1f1f8 100644 --- a/packages/php-wasm/node/src/lib/load-runtime.ts +++ b/packages/php-wasm/node/src/lib/load-runtime.ts @@ -8,12 +8,17 @@ import type { } from '@php-wasm/universal'; import { loadPHPRuntime, FSHelpers, bindUserSpace } from '@php-wasm/universal'; import fs from 'fs'; -import { getPHPLoaderModule } from '.'; +import { + FileLockManagerForPosix, + FileLockManagerForWindows, + getPHPLoaderModule, +} from '.'; import { withNetworking } from './networking/with-networking'; import { withXdebug, type XdebugOptions } from './xdebug/with-xdebug'; import { withIntl } from './extensions/intl/with-intl'; import { joinPaths } from '@php-wasm/util'; import { dirname } from 'path'; +import { platform } from 'os'; export interface PHPLoaderOptions { followSymlinks?: boolean; @@ -80,7 +85,11 @@ export async function loadNodeRuntime( bindUserSpace: (userSpaceContext: OSUserSpaceContext) => { return bindUserSpace( { - fileLockManager: options?.fileLockManager, + fileLockManager: + options?.fileLockManager ?? + (platform() === 'win32' + ? new FileLockManagerForWindows() + : new FileLockManagerForPosix()), }, userSpaceContext ); diff --git a/packages/php-wasm/node/src/test/file-lock-manager-for-posix--test-process.ts b/packages/php-wasm/node/src/test/file-lock-manager-for-posix--test-process.ts new file mode 100644 index 0000000000..0e8db37a74 --- /dev/null +++ b/packages/php-wasm/node/src/test/file-lock-manager-for-posix--test-process.ts @@ -0,0 +1,15 @@ +// eslint-disable-next-line @nx/enforce-module-boundaries +import { FileLockManagerForPosix } from '@php-wasm/node'; +import { exposeAPI } from '@php-wasm/universal'; +import { createRemoteProcessAPIFromFileLockManager } from './file-lock-manager-test-utils'; + +const fileLockManager = new FileLockManagerForPosix(); +const api = createRemoteProcessAPIFromFileLockManager(fileLockManager); +// TODO: Fix type error +// @ts-ignore +exposeAPI(api, null, process as NodeProcess); + +process.on('uncaughtException', (err) => { + // eslint-disable-next-line no-console + console.error('There was an uncaught error', err); +}); diff --git a/packages/php-wasm/node/src/test/file-lock-manager-for-posix.spec.ts b/packages/php-wasm/node/src/test/file-lock-manager-for-posix.spec.ts new file mode 100644 index 0000000000..348fb64728 --- /dev/null +++ b/packages/php-wasm/node/src/test/file-lock-manager-for-posix.spec.ts @@ -0,0 +1,11 @@ +import { declareFileLockManagerTests } from './file-lock-manager-tests'; +import { platform } from 'os'; + +declareFileLockManagerTests({ + name: 'FileLockManagerForPosix', + testWorkerUrl: new URL( + './file-lock-manager-for-posix--test-process.ts', + import.meta.url + ), + shouldSkip: platform() === 'win32', +}); diff --git a/packages/php-wasm/node/src/test/file-lock-manager-for-windows--test-process.ts b/packages/php-wasm/node/src/test/file-lock-manager-for-windows--test-process.ts new file mode 100644 index 0000000000..8b90fe2142 --- /dev/null +++ b/packages/php-wasm/node/src/test/file-lock-manager-for-windows--test-process.ts @@ -0,0 +1,15 @@ +// eslint-disable-next-line @nx/enforce-module-boundaries +import { FileLockManagerForWindows } from '@php-wasm/node'; +import { exposeAPI } from '@php-wasm/universal'; +import { createRemoteProcessAPIFromFileLockManager } from './file-lock-manager-test-utils'; + +const fileLockManager = new FileLockManagerForWindows(); +const api = createRemoteProcessAPIFromFileLockManager(fileLockManager); +// TODO: Fix type error +// @ts-ignore +exposeAPI(api, null, process as NodeProcess); + +process.on('uncaughtException', (err) => { + // eslint-disable-next-line no-console + console.error('There was an uncaught error', err); +}); diff --git a/packages/php-wasm/node/src/test/file-lock-manager-for-windows.spec.ts b/packages/php-wasm/node/src/test/file-lock-manager-for-windows.spec.ts new file mode 100644 index 0000000000..861ee1bbab --- /dev/null +++ b/packages/php-wasm/node/src/test/file-lock-manager-for-windows.spec.ts @@ -0,0 +1,11 @@ +import { declareFileLockManagerTests } from './file-lock-manager-tests'; +import { platform } from 'os'; + +declareFileLockManagerTests({ + name: 'FileLockManagerForWindows', + testWorkerUrl: new URL( + './file-lock-manager-for-windows--test-process.ts', + import.meta.url + ), + shouldSkip: platform() !== 'win32', +}); diff --git a/packages/php-wasm/node/src/test/file-lock-manager-test-utils.ts b/packages/php-wasm/node/src/test/file-lock-manager-test-utils.ts new file mode 100644 index 0000000000..8c55b438f6 --- /dev/null +++ b/packages/php-wasm/node/src/test/file-lock-manager-test-utils.ts @@ -0,0 +1,108 @@ +import { closeSync, openSync } from 'fs'; +import { + type FileLockManager, + type RequestedRangeLock, +} from '@php-wasm/universal'; + +// Node.js IPC transfers messages via JSON, +// and the BigInt elements of this API are not supported by JSON. +// So for testing, we define a version of the FileLockManager interface +// that uses numbers instead of BigInts for file content addresses. +// We don't need to use BigInts for testing but the actual FileLockManager interface +// has to use BigInts to handle the 64-bit address space. +export type RequestedRangeLockWithNonBigIntAddresses = Omit< + RequestedRangeLock, + 'start' | 'end' +> & { + start: number; + end: number; +}; +export type TestWorkerAPI = Omit< + FileLockManager, + 'lockFileByteRange' | 'findFirstConflictingByteRangeLock' +> & { + lockFileByteRange: ( + path: string, + requestedLock: RequestedRangeLockWithNonBigIntAddresses, + waitForLock: boolean + ) => boolean; + findFirstConflictingByteRangeLock: ( + path: string, + requestedLock: RequestedRangeLockWithNonBigIntAddresses + ) => Omit | undefined; + openSync: typeof openSync; + closeSync: typeof closeSync; +}; + +/** + * Create a remote process API for a file lock manager. + * + * @param fileLockManager - The file lock manager to create a remote process API for. + * @returns An API for the remote test process to expose. + */ +export function createRemoteProcessAPIFromFileLockManager( + fileLockManager: FileLockManager +): TestWorkerAPI { + // TODO: Clean up these tests. + // TODO: Fix this assignment if we proceed with these tests + // @ts-ignore + const api: TestWorkerAPI = fileLockManager as TestWorkerAPI; + const originalLockFileByteRange = + fileLockManager.lockFileByteRange.bind(fileLockManager); + api.lockFileByteRange = ( + path, + requestedLockWithNonBigIntAddresses, + waitForLock + ) => { + // Node.js IPC transfers messages via JSON, + // and the BigInt elements of this API are not supported by JSON. + // So for testing, we allow numbers to be passed instead, + // and we convert them to BigInts here. + const requestedLock = { + ...requestedLockWithNonBigIntAddresses, + start: BigInt(requestedLockWithNonBigIntAddresses.start), + end: BigInt(requestedLockWithNonBigIntAddresses.end), + }; + + return originalLockFileByteRange(path, requestedLock, waitForLock); + }; + const originalFindFirstConflictingByteRangeLock = + fileLockManager.findFirstConflictingByteRangeLock.bind(fileLockManager); + api.findFirstConflictingByteRangeLock = ( + path, + requestedLockWithNonBigIntAddresses + ): Omit | undefined => { + // Node.js IPC transfers messages via JSON, + // and the BigInt elements of this API are not supported by JSON. + // So for testing, we allow numbers to be passed instead, + // and we convert them to BigInts here. + const requestedLock: RequestedRangeLock = { + ...requestedLockWithNonBigIntAddresses, + start: BigInt(requestedLockWithNonBigIntAddresses.start), + end: BigInt(requestedLockWithNonBigIntAddresses.end), + }; + const result = originalFindFirstConflictingByteRangeLock( + path, + requestedLock + ); + if (result === undefined) { + return undefined; + } + return { + ...result, + start: Number(result.start as bigint), + end: Number(result.end as bigint), + }; + }; + // TODO: Make this less strange + // IPC with child processes uses JSON, and the URL type is not supported by JSON. + // So, if the input is a string that looks like a file URL, we convert it to a URL. + api.openSync = ((name: string | URL, ...rest) => { + if (typeof name === 'string' && name.startsWith('file://')) { + name = new URL(name); + } + return openSync(name, ...rest); + }) as typeof openSync; + api.closeSync = closeSync; + return api; +} diff --git a/packages/php-wasm/node/src/test/file-lock-manager-tests.ts b/packages/php-wasm/node/src/test/file-lock-manager-tests.ts new file mode 100644 index 0000000000..f4ca83d27b --- /dev/null +++ b/packages/php-wasm/node/src/test/file-lock-manager-tests.ts @@ -0,0 +1,1605 @@ +import { describe, beforeEach, afterEach, it, expect } from 'vitest'; +import { writeFileSync, unlinkSync } from 'fs'; +import { fork, type ChildProcess } from 'child_process'; +import { + consumeAPI, + releaseRemoteApiProxy, + type RemoteAPI, + type WholeFileLockOp, +} from '@php-wasm/universal'; +import type { TestWorkerAPI } from './file-lock-manager-test-utils'; + +// TODO: Review all tests with `end: 0` ranges. AI editing seems to have left broken tests. + +// TODO: Also test waiting for locks. +export function declareFileLockManagerTests({ + name, + testWorkerUrl, + // TODO: Re-enable or remove native tests because these are already native tests. + // TODO: Leave similar test file for FileLockManagerInMemory. + shouldSkip = false, +}: { + name: string; + testWorkerUrl: URL; + // We include this arg so we can acknowledge the tests + // exist but may be skipped (e.g., we skip POSIX tests on Windows). + shouldSkip?: boolean; +}) { + return describe.skipIf(shouldSkip)(name, () => { + let childProcess1: ChildProcess; + let childProcess2: ChildProcess; + let remoteProcessApi1: RemoteAPI; + let remoteProcessApi2: RemoteAPI; + let process1TestFile1Fd: number; + let process1TestFile2Fd: number; + let process2TestFile1Fd: number; + let process2TestFile2Fd: number; + + const PROCESS1_PID = 1; + const PROCESS2_PID = 2; + + const TEST_FILE1_URL = new URL('test1.txt', import.meta.url); + const TEST_FILE2_URL = new URL('test2.txt', import.meta.url); + + const createLockingProcess = async (): Promise< + [ChildProcess, RemoteAPI] + > => { + const child = fork(testWorkerUrl, { + execArgv: [ + '--experimental-strip-types', + '--experimental-transform-types', + '--disable-warning=ExperimentalWarning', + '--import', + './packages/meta/src/node-es-module-loader/register.mts', + ], + stdio: 'inherit', + }); + // TODO: Fix this type error. + // @ts-ignore + const api = await consumeAPI(child); + + return [child, api]; + }; + const killLockingProcess = ( + childProcess: ChildProcess + ): Promise => + new Promise((resolve) => { + childProcess.on('exit', resolve); + childProcess.kill(); + }); + + beforeEach(async () => { + writeFileSync(TEST_FILE1_URL, `test file 1 for ${import.meta.url}`); + writeFileSync(TEST_FILE2_URL, `test file 2 for ${import.meta.url}`); + + [childProcess1, remoteProcessApi1] = await createLockingProcess(); + [childProcess2, remoteProcessApi2] = await createLockingProcess(); + + process1TestFile1Fd = await remoteProcessApi1.openSync( + TEST_FILE1_URL, + 'r+' + ); + process1TestFile2Fd = await remoteProcessApi1.openSync( + TEST_FILE2_URL, + 'r+' + ); + process2TestFile1Fd = await remoteProcessApi2.openSync( + TEST_FILE1_URL, + 'r+' + ); + process2TestFile2Fd = await remoteProcessApi2.openSync( + TEST_FILE2_URL, + 'r+' + ); + }); + + afterEach(async () => { + await Promise.all([ + remoteProcessApi1 && remoteProcessApi1[releaseRemoteApiProxy](), + remoteProcessApi2 && remoteProcessApi2[releaseRemoteApiProxy](), + ]); + await Promise.all([ + killLockingProcess(childProcess1), + killLockingProcess(childProcess2), + ]); + + unlinkSync(TEST_FILE1_URL); + unlinkSync(TEST_FILE2_URL); + }); + + describe('lockWholeFile', () => { + describe('exclusive', () => { + it('allows when unlocked', async () => { + const result = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result).toBe(true); + }); + + it('allows when the process already holds a lock with the same file descriptor', async () => { + const requestedLock: WholeFileLockOp = { + type: 'exclusive', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + }; + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + requestedLock + ); + expect(result1).toBe(true); + + const result2 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + requestedLock + ); + expect(result2).toBe(true); + }); + + it('denies when only whole-file locked by same process with different file descriptor', async () => { + // First lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + const testFile1Fd2 = await remoteProcessApi1.openSync( + TEST_FILE1_URL, + 'r+' + ); + // Second lock by same process + const result2 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS1_PID, + fd: testFile1Fd2, + waitForLock: false, + } + ); + expect(result2).toBe(false); + }); + + it('denies when other process holds exclusive whole-file lock', async () => { + // This process locks + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Remote process tries to lock + const result2 = await remoteProcessApi2.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + waitForLock: false, + } + ); + expect(result2).toBe(false); + }); + + it('denies when other process holds shared whole-file lock', async () => { + // First process gets shared lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Second process tries to get exclusive lock + const result2 = await remoteProcessApi2.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + waitForLock: false, + } + ); + expect(result2).toBe(false); + }); + + it('denies when other process holds shared range lock', async () => { + // First process gets shared range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Second process tries to get exclusive whole-file lock + const result2 = await remoteProcessApi2.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + waitForLock: false, + } + ); + expect(result2).toBe(false); + }); + }); + describe('shared', () => { + it('allows when unlocked', async () => { + const result = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result).toBe(true); + }); + + it('allows when only whole-file locked by same process', async () => { + const testFile1Fd2 = await remoteProcessApi1.openSync( + TEST_FILE1_URL, + 'r+' + ); + // First lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Second lock by same process + const result2 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS1_PID, + fd: testFile1Fd2, + waitForLock: false, + } + ); + expect(result2).toBe(true); + }); + + it('denies when other process holds exclusive whole-file lock', async () => { + // First process gets exclusive lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Second process tries to get shared lock + const result2 = await remoteProcessApi2.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + waitForLock: false, + } + ); + expect(result2).toBe(false); + }); + + it('allows when same process holds shared whole-file lock', async () => { + // First process gets shared lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Second process gets shared lock + const result2 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result2).toBe(true); + }); + + it('allows when other process holds shared whole-file lock', async () => { + // First process gets shared lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Second process gets shared lock + const result2 = await remoteProcessApi2.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + waitForLock: false, + } + ); + expect(result2).toBe(true); + }); + + it('allows when other process holds shared range lock', async () => { + // First process gets shared range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Second process gets shared whole-file lock + const result2 = await remoteProcessApi2.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + waitForLock: false, + } + ); + expect(result2).toBe(true); + }); + }); + describe('unlock', () => { + it('does not error when file already unlocked', async () => { + const result = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'unlock', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + } + ); + expect(result).toBe(true); + }); + + it('unlocks shared lock for matching process', async () => { + // First get a shared lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Unlock it + await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'unlock', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + } + ); + + // Verify it's unlocked by getting an exclusive lock for another process + const result2 = await remoteProcessApi2.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + waitForLock: false, + } + ); + expect(result2).toBe(true); + }); + + it('unlocks exclusive lock for matching process', async () => { + // First get an exclusive lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Unlock it + const result2 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'unlock', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + } + ); + expect(result2).toBe(true); + + // Verify it's unlocked by getting an exclusive lock + const result3 = await remoteProcessApi2.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + waitForLock: false, + } + ); + expect(result3).toBe(true); + }); + }); + }); + + describe('lockFileByteRange', () => { + describe('exclusive', () => { + it('allows when file unlocked', async () => { + const result = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result).toBe(true); + }); + + it('denies when other process holds exclusive whole-file lock', async () => { + // First process gets exclusive whole-file lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Second process tries to get exclusive range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(false); + }); + + it('denies when other process holds shared whole-file lock', async () => { + // First process gets shared whole-file lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Second process tries to get exclusive range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(false); + }); + + it('denies when other process holds overlapping exclusive range lock', async () => { + // First process gets exclusive range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 10, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Second process tries to get overlapping exclusive range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 5, + end: 15, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(false); + }); + + it('denies when other process holds overlapping shared range lock', async () => { + // First process gets shared range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Second process tries to get overlapping exclusive range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(false); + }); + + it('allows when other process holds non-overlapping exclusive range lock', async () => { + // First process gets exclusive range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 10, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Second process gets non-overlapping exclusive range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 15, + end: 20, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + }); + // TODO: Test locking to end of addressable range. + + it('allows when other process holds non-overlapping shared range lock', async () => { + // First process gets shared range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 10, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Second process gets non-overlapping exclusive range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 20, + end: 30, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + }); + + // TODO: This is not implemented for Windows. Keep it or explicitly enforce no overlap? + it.skip('new lock request merges with overlapping locks from same process', async () => { + // First get an exclusive range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Replace it with a new overlapping lock + const result2 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + + // Verify the old lock range is in place by trying to get a lock in that range + const obtainedExclusiveLockOnOldRange = + await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(obtainedExclusiveLockOnOldRange).toBe(false); + + // Verify the new lock range is in place by trying to get a lock in that range + const obtainedExclusiveLockOnNewRange = + await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(obtainedExclusiveLockOnNewRange).toBe(false); + }); + + it('treats a range with zero length as covering entire remaining range', async () => { + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 10, + end: 10, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Try to get a lock after the zero-length lock + const result3 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 15, + end: 20, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result3).toBe(false); + }); + }); + describe('shared', () => { + it('allows when file unlocked', async () => { + const result = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result).toBe(true); + }); + + it('denies when other process holds exclusive whole-file lock', async () => { + // First process gets exclusive whole-file lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Second process tries to get shared range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(false); + }); + + it('allows when other process holds shared whole-file lock', async () => { + // First process gets shared whole-file lock + const result1 = await remoteProcessApi1.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + } + ); + expect(result1).toBe(true); + + // Second process gets shared range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + }); + + it('denies when other process holds overlapping exclusive range lock', async () => { + // First process gets exclusive range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 10, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Second process tries to get overlapping shared range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 5, + end: 15, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(false); + }); + + it('allows when other process holds overlapping shared range lock', async () => { + // First process gets shared range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 10, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Second process gets overlapping shared range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 5, + end: 15, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + }); + + it('allows when other process holds non-overlapping exclusive range lock', async () => { + // First process gets exclusive range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 10, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Second process gets non-overlapping shared range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 15, + end: 20, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + }); + + it('allows when other process holds non-overlapping shared range lock', async () => { + // First process gets shared range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 10, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Second process gets non-overlapping shared range lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 15, + end: 20, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + }); + + // TODO: Re-enable this once native lock managers support fcntl() merging of locked ranges. + it.skip('new lock request merges with overlapping locks from same process', async () => { + // First get a shared range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Replace it with a new overlapping lock + const result2 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + + // Verify the old lock is gone by trying to get a lock in that range + const result3 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result3).toBe(true); + }); + + it('treats a range with zero length as covering entire remaining range', async () => { + // First get a shared range lock with zero length + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 30, + end: 30, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Confirm correct starting point by getting an exclusive lock + // before the start of the "infinite" range. + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 10, + end: 29, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + + // Confirm the rest of the file is already locked by attempting to exclusively lock + // within a large part of that range + const result3 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 40, + end: Number.MAX_SAFE_INTEGER - 100, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result3).toBe(false); + }); + }); + describe.skip('unlock', () => { + it('does not error when range not locked by current process', async () => { + await expect( + remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'unlocked', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ) + ).resolves.toBeDefined(); + }); + + it('unlocks shared lock', async () => { + // First get a shared range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Unlock it + await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'unlocked', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + + // Verify it's unlocked by getting an exclusive lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + }); + + it('unlocks exclusive lock', async () => { + // First get an exclusive range lock + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Unlock it + await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'unlocked', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + + // Verify it's unlocked by getting an exclusive lock + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + }); + it('unlocks tail of owned locked range when that range overlaps head of unlocked range', async () => { + // Get a lock from 0-100 + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Unlock range 50-150 which overlaps tail of existing lock + await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'unlocked', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + + // Verify we can now lock 50-100 but not 0-50 + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + + const result3 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result3).toBe(false); + }); + + // TODO: Re-enable this once native lock managers support fcntl() partial range unlocking. + it.skip('unlocks head of owned locked range when that range overlaps tail of unlocked range', async () => { + // Get a lock from 50-150 + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Unlock range 0-100 which overlaps head of existing lock + await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'unlocked', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + + // Verify we can now lock 50-100 but not 100-150 + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + + const result3 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result3).toBe(false); + }); + + // TODO: Re-enable this once native lock managers support fcntl() splitting of locked ranges. + it.skip('splits locked range when that range completely contains unlocked range', async () => { + // Get a lock from 0-200 + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Unlock range 50-150 which is contained within existing lock + await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'unlocked', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + + // Verify we can now lock 50-150 but not 0-50 or 150-200 + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + + const result3 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result3).toBe(false); + + const result4 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result4).toBe(false); + }); + + it('treats a range with zero length as covering entire remaining range', async () => { + // First get a lock with zero length + const result1 = await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + expect(result1).toBe(true); + + // Unlock it + await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'unlocked', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + + // Verify it's unlocked by getting a lock after that point + const result2 = await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + expect(result2).toBe(true); + }); + }); + }); + + describe('findFirstConflictingByteRangeLock', () => { + it('should find conflicting exclusive lock with partial overlap', async () => { + await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 0, + end: 0, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + + const conflict = + await remoteProcessApi2.findFirstConflictingByteRangeLock( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 0, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + } + ); + + expect(conflict).toBeDefined(); + expect(conflict?.type).toBe('exclusive'); + // We cannot query what lock truly conflicts on Windows, + // so we report a non-standard dummy PID. + expect(conflict?.pid).toBe(-1); + // TODO: Consider removing this because it is unlikely to every be supported + // because Windows has no way to query info about conflicting locks. + // TODO: Uncomment this once we are able to query what lock truly conflicts. + // expect(conflict?.pid).toBe(PROCESS1_PID); + }); + + it('should return undefined when no conflict exists', async () => { + const conflict = + await remoteProcessApi2.findFirstConflictingByteRangeLock( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 20, + end: 30, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + } + ); + + expect(conflict).toBeUndefined(); + }); + }); + + describe('releaseLocksForProcess', () => { + it('should release all range locks held by a process across multiple ranges', async () => { + await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 50, + end: 100, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + await remoteProcessApi1.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'exclusive', + start: 200, + end: 300, + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + }, + false + ); + const exclusiveLockAppearsToBeHeld = + !(await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 500, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + )); + expect(exclusiveLockAppearsToBeHeld).toBe(true); + + await remoteProcessApi1.lockFileByteRange( + TEST_FILE2_URL.pathname, + { + type: 'shared', + start: 50, + end: 100, + pid: PROCESS1_PID, + fd: process1TestFile2Fd, + }, + false + ); + const sharedLockAppearsToBeHeld = + !(await remoteProcessApi2.lockFileByteRange( + TEST_FILE2_URL.pathname, + { + type: 'exclusive', + start: 25, + end: 150, + pid: PROCESS2_PID, + fd: process2TestFile2Fd, + }, + false + )); + expect(sharedLockAppearsToBeHeld).toBe(true); + + await remoteProcessApi1.releaseLocksForProcess(PROCESS1_PID); + + // Verify locks are released by trying to acquire conflicting locks + const exclusiveLockAppearsToBeReleased = + await remoteProcessApi2.lockFileByteRange( + TEST_FILE1_URL.pathname, + { + type: 'shared', + start: 0, + end: 500, + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + }, + false + ); + const sharedLockAppearsToBeReleased = + await remoteProcessApi2.lockFileByteRange( + TEST_FILE2_URL.pathname, + { + type: 'exclusive', + start: 25, + end: 150, + pid: PROCESS2_PID, + fd: process2TestFile2Fd, + }, + false + ); + + expect(exclusiveLockAppearsToBeReleased).toBe(true); + expect(sharedLockAppearsToBeReleased).toBe(true); + }); + + it('should release all whole-file locks held by a process', async () => { + await remoteProcessApi1.lockWholeFile(TEST_FILE1_URL.pathname, { + type: 'exclusive', + + pid: PROCESS1_PID, + fd: process1TestFile1Fd, + waitForLock: false, + }); + const exclusiveLockAppearsToBeHeld = + !(await remoteProcessApi2.lockWholeFile( + TEST_FILE1_URL.pathname, + { + type: 'shared', + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + waitForLock: false, + } + )); + expect(exclusiveLockAppearsToBeHeld).toBe(true); + + await remoteProcessApi1.lockWholeFile(TEST_FILE2_URL.pathname, { + type: 'shared', + pid: PROCESS1_PID, + fd: process1TestFile2Fd, + waitForLock: false, + }); + const sharedLockAppearsToBeHeld = + !(await remoteProcessApi2.lockWholeFile( + TEST_FILE2_URL.pathname, + { + type: 'exclusive', + pid: PROCESS2_PID, + fd: process2TestFile2Fd, + waitForLock: false, + } + )); + expect(sharedLockAppearsToBeHeld).toBe(true); + + await remoteProcessApi1.releaseLocksForProcess(PROCESS1_PID); + + const lockToConfirmExclusiveLockRelease: WholeFileLockOp = { + type: 'shared', + pid: PROCESS2_PID, + fd: process2TestFile1Fd, + waitForLock: false, + }; + const exclusiveLockAppearsToBeReleased = + await remoteProcessApi2.lockWholeFile( + TEST_FILE2_URL.pathname, + lockToConfirmExclusiveLockRelease + ); + expect(exclusiveLockAppearsToBeReleased).toBe(true); + const sharedLockAppearsToBeReleased = + await remoteProcessApi2.lockWholeFile( + TEST_FILE2_URL.pathname, + { + type: 'exclusive', + pid: PROCESS2_PID, + fd: process2TestFile2Fd, + waitForLock: false, + } + ); + expect(sharedLockAppearsToBeReleased).toBe(true); + }); + }); + }); +} diff --git a/packages/php-wasm/node/src/test/file-lock-test-worker.js b/packages/php-wasm/node/src/test/file-lock-test-worker.js deleted file mode 100644 index d79934f556..0000000000 --- a/packages/php-wasm/node/src/test/file-lock-test-worker.js +++ /dev/null @@ -1,34 +0,0 @@ -import { openSync, closeSync } from 'fs'; -import { flockSync } from 'fs-ext'; - -process.on('message', (message) => { - if (message.type === 'acquire') { - try { - // Open the file - const fd = openSync(message.filePath, 'a+'); - - // Convert lock type to flock flags - const flockFlags = - message.lockType === 'exclusive' ? 'exnb' : 'shnb'; - - // Attempt to acquire the lock - try { - flockSync(fd, flockFlags); - process.send?.({ type: 'success', fd }); - } catch (error) { - closeSync(fd); - process.send?.({ - type: 'error', - error: error?.message || 'Unknown error', - }); - } - } catch (error) { - process.send?.({ - type: 'error', - error: error?.message || 'Unknown error', - }); - } - } else if (message.type === 'release') { - process.exit(0); - } -}); diff --git a/packages/php-wasm/node/src/test/php-file-locking.spec.ts b/packages/php-wasm/node/src/test/php-file-locking.spec.ts index 4fb24a5078..3277d76e07 100644 --- a/packages/php-wasm/node/src/test/php-file-locking.spec.ts +++ b/packages/php-wasm/node/src/test/php-file-locking.spec.ts @@ -10,12 +10,9 @@ import { import { SupportedPHPVersions, type FileLockManager, + FileLockManagerInMemory, } from '@php-wasm/universal'; -import { - createNodeFsMountHandler, - FileLockManagerForNode, - loadNodeRuntime, -} from '../lib'; +import { createNodeFsMountHandler, loadNodeRuntime } from '../lib'; import { joinPaths, /* eslint-disable-next-line @typescript-eslint/no-unused-vars -- @@ -34,12 +31,12 @@ describe.each(phpVersionsToTest)('PHP %s: File locking', (phpVersion) => { let tempDir: string; // TODO: Use one file lock manager per test - let fileLockManager: FileLockManagerForNode; + let fileLockManager: FileLockManagerInMemory; let nextProcessId: number; beforeEach(async () => { tempDir = mkdtempSync(join(tmpdir(), 'php-wasm-file-locking-')); - fileLockManager = new FileLockManagerForNode(); + fileLockManager = new FileLockManagerInMemory(); nextProcessId = 1; }); afterEach(async () => { @@ -1425,7 +1422,7 @@ error_log = ${errorLogPath} findFirstConflictingByteRangeLock: vi .fn() .mockReturnValue(undefined), - releaseLocksForProcessFd: vi.fn().mockReturnValue(undefined), + releaseLocksOnFdClose: vi.fn().mockReturnValue(undefined), releaseLocksForProcess: vi.fn().mockReturnValue(undefined), }; } diff --git a/packages/php-wasm/universal/src/lib/api.ts b/packages/php-wasm/universal/src/lib/api.ts index 4112c2a544..f833985aac 100644 --- a/packages/php-wasm/universal/src/lib/api.ts +++ b/packages/php-wasm/universal/src/lib/api.ts @@ -3,12 +3,16 @@ import { PHPResponse, StreamedPHPResponse } from './php-response'; import * as Comlink from './comlink-sync'; import { NodeSABSyncReceiveMessageTransport, - nodeEndpoint, - type NodeEndpoint, + nodeEndpoint as nodeWorkerEndpoint, + type NodeEndpoint as NodeWorker, type Remote, type Endpoint, type IsomorphicMessagePort, } from './comlink-sync'; +import { + type NodeProcess, + NodeProcessAdapter, +} from './comlink-node-process-adapter'; import * as ErrorSerializer from './serialize-error'; export type WithAPIState = { @@ -34,7 +38,7 @@ export async function consumeAPISync( } export function consumeAPI( - remote: Worker | Window | NodeEndpoint, + remote: Worker | Window | NodeWorker | NodeProcess, context: undefined | EventTarget = undefined ): RemoteAPI { setupTransferHandlers(); @@ -42,7 +46,11 @@ export function consumeAPI( let endpoint; const appearsToBeNodeEnvironment = import.meta.url.startsWith('file://'); if (appearsToBeNodeEnvironment) { - endpoint = nodeEndpoint(remote as NodeEndpoint); + if ('postMessage' in remote) { + endpoint = nodeWorkerEndpoint(remote as NodeWorker); + } else { + endpoint = new NodeProcessAdapter(remote as NodeProcess); + } } else { endpoint = remote instanceof Worker @@ -102,7 +110,7 @@ export type PublicAPI = RemoteAPI< export function exposeAPI( apiMethods?: Methods, pipedApi?: PipedAPI, - targetWorker?: NodeEndpoint + targetWorker?: NodeWorker | NodeProcess ): [() => void, (e: Error) => void, PublicAPI] { const { setReady, setFailed, exposedApi } = prepareForExpose( apiMethods, @@ -110,9 +118,11 @@ export function exposeAPI( ); let endpoint: Endpoint | undefined; if (targetWorker) { - // NOTE: If there are other target types, we could expand this later, - // but for now, we only need support for NodeEndpoints. - endpoint = nodeEndpoint(targetWorker); + if ('postMessage' in targetWorker) { + endpoint = nodeWorkerEndpoint(targetWorker); + } else { + endpoint = new NodeProcessAdapter(targetWorker); + } } else { endpoint = typeof window !== 'undefined' @@ -129,7 +139,7 @@ export async function exposeSyncAPI( ): Promise<[() => void, (e: Error) => void, Methods]> { const { setReady, setFailed, exposedApi } = prepareForExpose(apiMethods); const transport = await NodeSABSyncReceiveMessageTransport.create(); - const endpoint = nodeEndpoint(port as any); + const endpoint = nodeWorkerEndpoint(port as any); Comlink.exposeSync(exposedApi, endpoint, transport); return [setReady, setFailed, exposedApi as Methods]; } diff --git a/packages/php-wasm/universal/src/lib/comlink-node-process-adapter.ts b/packages/php-wasm/universal/src/lib/comlink-node-process-adapter.ts new file mode 100644 index 0000000000..bef750b690 --- /dev/null +++ b/packages/php-wasm/universal/src/lib/comlink-node-process-adapter.ts @@ -0,0 +1,82 @@ +import type { Endpoint } from './comlink-sync'; +import type { EventEmitter } from 'events'; + +// Handle the difference between EventEmitter (Node) and EventTarget (web). +const proxyByListener: WeakMap< + EventListenerOrEventListenerObject, + (...args: any[]) => void +> = new WeakMap(); + +type EventEmitterWithSend = Pick< + EventEmitter, + 'addListener' | 'removeListener' +> & { + send?: (...args: any[]) => unknown; +}; + +export interface NodeProcess { + send: (...args: any[]) => unknown; + addListener: ( + type: string, + listener: EventListenerOrEventListenerObject + ) => void; + removeListener: ( + type: string, + listener: EventListenerOrEventListenerObject + ) => void; +} + +// TODO: Is there a way to assert that all types passed to remote APIs are simple values or objects? +// TODO: Make this a function like the other adapters? +export class NodeProcessAdapter implements Endpoint { + private readonly emitter: EventEmitterWithSend; + + constructor(worker?: NodeProcess) { + const emitter = (worker || process) as EventEmitter; + if (typeof (emitter as EventEmitterWithSend).send !== 'function') { + throw new Error( + 'IPC channel is not available. Did you forget to fork the process?' + ); + } + this.emitter = emitter as EventEmitterWithSend; + } + + postMessage(message: unknown, _transferList?: Transferable[]) { + if (_transferList && _transferList.length > 0) { + throw new Error( + 'Transferable objects are not supported for NodeProcessAdapter' + ); + } + this.emitter.send?.(message); + } + + addEventListener( + type: string, + listener: EventListenerOrEventListenerObject + ) { + const proxy = + typeof listener === 'function' + ? (data: unknown) => listener({ data } as MessageEvent) + : (data: unknown) => + listener.handleEvent({ data } as MessageEvent); + proxyByListener.set(listener, proxy); + this.emitter.addListener(type, proxy); + } + + removeEventListener( + type: string, + listener: EventListenerOrEventListenerObject + ) { + const proxy = proxyByListener.get(listener); + if (!proxy) { + return; + } + + proxyByListener.delete(listener); + this.emitter.removeListener(type, proxy); + } + + start() { + // EventEmitter-based endpoints do not need explicit start logic. + } +} diff --git a/packages/php-wasm/universal/src/lib/file-lock-interval-tree.ts b/packages/php-wasm/universal/src/lib/file-lock-interval-tree.ts new file mode 100644 index 0000000000..ce197e2e29 --- /dev/null +++ b/packages/php-wasm/universal/src/lib/file-lock-interval-tree.ts @@ -0,0 +1,217 @@ +import type { RequestedRangeLock } from './file-lock-manager'; + +export type LockedRange = RequestedRangeLock & { + type: Exclude; +}; + +class IntervalNode { + range: LockedRange; + max: bigint; + left: IntervalNode | null = null; + right: IntervalNode | null = null; + + constructor(range: LockedRange) { + this.range = range; + this.max = range.end; + } +} + +export class FileLockIntervalTree { + private root: IntervalNode | null = null; + + isEmpty() { + return this.root === null; + } + + /** + * Insert a new locked range into the tree + */ + insert(range: LockedRange): void { + this.root = this.insertNode(this.root, range); + } + + /** + * Find all ranges that overlap with the given range + */ + findOverlapping(range: RequestedRangeLock): LockedRange[] { + const result: LockedRange[] = []; + this.findOverlappingRanges(this.root, range, result); + return result; + } + + /** + * Remove a lock range from the tree + */ + remove(range: RequestedRangeLock): void { + this.root = this.removeNode(this.root, range); + } + + /** + * Find all ranges locked by the given process. + * + * @param pid The process ID to find locks for. + * @returns All locked ranges for the given process. + */ + findLocksForProcess(pid: number): RequestedRangeLock[] { + const result: RequestedRangeLock[] = []; + this.findLocksForProcessInNode(this.root, pid, result); + return result; + } + + /** + * Find the strictest existing lock type in the range lock tree. + * + * @returns The strictest existing lock type, or 'unlocked' if no locks exist. + */ + findStrictestExistingLockType(): RequestedRangeLock['type'] { + let maxType: RequestedRangeLock['type'] = 'unlocked'; + + const traverse = (node: IntervalNode | null) => { + if (!node) { + return; + } + if (node.range.type === 'exclusive') { + maxType = 'exclusive'; + return; // Can stop early since exclusive is highest + } + if (node.range.type === 'shared') { + maxType = 'shared'; + } + traverse(node.left); + traverse(node.right); + }; + traverse(this.root); + + return maxType; + } + + private insertNode( + node: IntervalNode | null, + range: LockedRange + ): IntervalNode { + if (!node) { + return new IntervalNode(range); + } + + // Insert to left subtree if start is less than node's start + if (range.start < node.range.start) { + node.left = this.insertNode(node.left, range); + } else { + node.right = this.insertNode(node.right, range); + } + + // Update max value + node.max = this.bigintMax(node.max, range.end); + return node; + } + + private bigintMax(...args: bigint[]): bigint { + return args.reduce((max, current) => { + return current > max ? current : max; + }, args[0]); + } + + private findOverlappingRanges( + node: IntervalNode | null, + range: RequestedRangeLock, + result: LockedRange[] + ): void { + if (!node) { + return; + } + + // Check if current node overlaps + if (this.doRangesOverlap(node.range, range)) { + result.push(node.range); + } + + // If left child exists and its max is greater than range start, search left + if (node.left && node.left.max >= range.start) { + this.findOverlappingRanges(node.left, range, result); + } + + // Search right if it could contain overlapping intervals + if (node.right && node.range.start <= range.end) { + this.findOverlappingRanges(node.right, range, result); + } + } + + private doRangesOverlap( + a: RequestedRangeLock, + b: RequestedRangeLock + ): boolean { + return a.start < b.end && b.start < a.end; + } + + private removeNode( + node: IntervalNode | null, + range: RequestedRangeLock + ): IntervalNode | null { + if (!node) { + return null; + } + + // Check if current node is the one to remove + if (this.areRangesEqual(node.range, range)) { + // Handle cases of no children or one child + if (!node.left) { + return node.right; + } + if (!node.right) { + return node.left; + } + + // Node has two children - find successor + const successor = this.findMin(node.right); + node.range = successor.range; + node.right = this.removeNode(node.right, successor.range); + } else if (range.start < node.range.start) { + node.left = this.removeNode(node.left, range); + } else { + node.right = this.removeNode(node.right, range); + } + + // Update max value + node.max = node.range.end; + if (node.left) { + node.max = this.bigintMax(node.max, node.left.max); + } + if (node.right) { + node.max = this.bigintMax(node.max, node.right.max); + } + + return node; + } + + private findMin(node: IntervalNode): IntervalNode { + let current = node; + while (current.left) { + current = current.left; + } + return current; + } + + private areRangesEqual( + a: RequestedRangeLock, + b: RequestedRangeLock + ): boolean { + return a.start === b.start && a.end === b.end && a.pid === b.pid; + } + + private findLocksForProcessInNode( + node: IntervalNode | null, + pid: number, + result: RequestedRangeLock[] + ): void { + if (!node) { + return; + } + + if (node.range.pid === pid) { + result.push(node.range); + } + + this.findLocksForProcessInNode(node.left, pid, result); + this.findLocksForProcessInNode(node.right, pid, result); + } +} diff --git a/packages/php-wasm/node/src/test/file-lock-manager-for-node.spec.ts b/packages/php-wasm/universal/src/lib/file-lock-manager-in-memory.spec.ts similarity index 84% rename from packages/php-wasm/node/src/test/file-lock-manager-for-node.spec.ts rename to packages/php-wasm/universal/src/lib/file-lock-manager-in-memory.spec.ts index b9c9aa4a39..4b88315cd5 100644 --- a/packages/php-wasm/node/src/test/file-lock-manager-for-node.spec.ts +++ b/packages/php-wasm/universal/src/lib/file-lock-manager-in-memory.spec.ts @@ -1,19 +1,15 @@ import { writeFileSync, unlinkSync } from 'fs'; -import { FileLockManagerForNode } from '../lib/file-lock-manager-for-node'; -import { fork } from 'child_process'; -import type { ChildProcess } from 'child_process'; -import { join } from 'path'; -import { type WholeFileLockOp } from '@php-wasm/universal'; -import { flockSync as nativeFlockSync } from 'fs-ext'; +import { FileLockManagerInMemory } from './file-lock-manager-in-memory'; +import type { WholeFileLockOp } from '../lib/file-lock-manager'; const TEST_FILE1 = new URL('test1.txt', import.meta.url).pathname; const TEST_FILE2 = new URL('test2.txt', import.meta.url).pathname; describe('FileLockManagerForNode', () => { - let lockManager: FileLockManagerForNode; + let lockManager: FileLockManagerInMemory; beforeEach(() => { - lockManager = new FileLockManagerForNode(nativeFlockSync); + lockManager = new FileLockManagerInMemory(); writeFileSync(TEST_FILE1, `test file 1 for ${import.meta.url}`); writeFileSync(TEST_FILE2, `test file 2 for ${import.meta.url}`); }); @@ -1279,207 +1275,4 @@ describe('FileLockManagerForNode', () => { expect(result).toBe(false); }); }); - - describe('integration with native OS file locking', () => { - let childProcess: ChildProcess | undefined; - - afterEach(async () => { - if (childProcess) { - await killProcess(childProcess); - childProcess = undefined; - } - }); - - it('cannot acquire exclusive lock when native exclusive lock exists', async () => { - // Child process gets native exclusive lock - const result1 = await spawnLockProcess(TEST_FILE1, 'exclusive'); - expect(result1).toEqual({ - success: true, - child: expect.any(Object), - }); - childProcess = result1.child; - - // Try to get exclusive lock through lock manager - const result2 = lockManager.lockWholeFile(TEST_FILE1, { - type: 'exclusive', - pid: 1, - fd: 1, - }); - expect(result2).toBe(false); - }); - - it('cannot acquire shared lock when native exclusive lock exists', async () => { - // Child process gets native exclusive lock - const result1 = await spawnLockProcess(TEST_FILE1, 'exclusive'); - expect(result1).toEqual({ - success: true, - child: expect.any(Object), - }); - childProcess = result1.child; - - // Try to get shared lock through lock manager - const result2 = lockManager.lockWholeFile(TEST_FILE1, { - type: 'shared', - pid: 1, - fd: 1, - }); - expect(result2).toBe(false); - }); - - it('can acquire shared lock when native shared lock exists', async () => { - // Child process gets native shared lock - const result1 = await spawnLockProcess(TEST_FILE1, 'shared'); - expect(result1).toEqual({ - success: true, - child: expect.any(Object), - }); - childProcess = result1.child; - - // Try to get shared lock through lock manager - const result2 = lockManager.lockWholeFile(TEST_FILE1, { - type: 'shared', - pid: 1, - fd: 1, - }); - expect(result2).toBe(true); - }); - - it('cannot acquire exclusive lock when native shared lock exists', async () => { - // Child process gets native shared lock - const result1 = await spawnLockProcess(TEST_FILE1, 'shared'); - expect(result1).toEqual({ - success: true, - child: expect.any(Object), - }); - childProcess = result1.child; - - // Try to get exclusive lock through lock manager - const result2 = lockManager.lockWholeFile(TEST_FILE1, { - type: 'exclusive', - pid: 1, - fd: 1, - }); - expect(result2).toBe(false); - }); - - it('cannot acquire exclusive range lock when native exclusive lock exists', async () => { - // Child process gets native exclusive lock - const result1 = await spawnLockProcess(TEST_FILE1, 'exclusive'); - expect(result1).toEqual({ - success: true, - child: expect.any(Object), - }); - childProcess = result1.child; - - // Try to get exclusive range lock through lock manager - const result2 = lockManager.lockFileByteRange(TEST_FILE1, { - type: 'exclusive', - start: 0n, - end: 100n, - pid: 1, - }); - expect(result2).toBe(false); - }); - - it('cannot acquire shared range lock when native exclusive lock exists', async () => { - // Child process gets native exclusive lock - const result1 = await spawnLockProcess(TEST_FILE1, 'exclusive'); - expect(result1).toEqual({ - success: true, - child: expect.any(Object), - }); - childProcess = result1.child; - - // Try to get shared range lock through lock manager - const result2 = lockManager.lockFileByteRange(TEST_FILE1, { - type: 'shared', - start: 0n, - end: 100n, - pid: 1, - }); - expect(result2).toBe(false); - }); - - it('can acquire shared range lock when native shared lock exists', async () => { - // Child process gets native shared lock - const result1 = await spawnLockProcess(TEST_FILE1, 'shared'); - expect(result1).toEqual({ - success: true, - child: expect.any(Object), - }); - childProcess = result1.child; - - // Try to get shared range lock through lock manager - const result2 = lockManager.lockFileByteRange(TEST_FILE1, { - type: 'shared', - start: 0n, - end: 100n, - pid: 1, - }); - expect(result2).toBe(true); - }); - - it('cannot acquire exclusive range lock when native shared lock exists', async () => { - // Child process gets native shared lock - const result1 = await spawnLockProcess(TEST_FILE1, 'shared'); - expect(result1).toEqual({ - success: true, - child: expect.any(Object), - }); - childProcess = result1.child; - - // Try to get exclusive range lock through lock manager - const result2 = lockManager.lockFileByteRange(TEST_FILE1, { - type: 'exclusive', - start: 0n, - end: 100n, - pid: 1, - }); - expect(result2).toBe(false); - }); - - // Helper function to spawn a child process that will attempt to acquire a lock - function spawnLockProcess( - filePath: string, - lockType: 'exclusive' | 'shared' - ): Promise<{ success: boolean; error?: string; child?: ChildProcess }> { - return new Promise((resolve) => { - const child = fork(join(__dirname, 'file-lock-test-worker.js')); - - child.on( - 'message', - (message: { - type: 'success' | 'error'; - fd?: number; - error?: string; - }) => { - if (message.type === 'success') { - resolve({ success: true, child }); - } else { - resolve({ - success: false, - error: message.error, - child, - }); - } - } - ); - - child.on('error', (error) => { - resolve({ success: false, error: error.message, child }); - }); - - child.send({ type: 'acquire', filePath, lockType }); - }); - } - - // Helper function to kill a process - async function killProcess(child: ChildProcess): Promise { - return new Promise((resolve) => { - child.send({ type: 'release' }); - // Give the process a moment to clean up - child.on('exit', resolve); - }); - } - }); }); diff --git a/packages/php-wasm/node/src/lib/file-lock-manager-for-node.ts b/packages/php-wasm/universal/src/lib/file-lock-manager-in-memory.ts similarity index 55% rename from packages/php-wasm/node/src/lib/file-lock-manager-for-node.ts rename to packages/php-wasm/universal/src/lib/file-lock-manager-in-memory.ts index a242b0d51a..182a979e95 100644 --- a/packages/php-wasm/node/src/lib/file-lock-manager-for-node.ts +++ b/packages/php-wasm/universal/src/lib/file-lock-manager-in-memory.ts @@ -1,11 +1,3 @@ -import { logger } from '@php-wasm/logger'; -import { openSync, closeSync } from 'fs'; - -type NativeFlockSync = ( - fd: number, - flags: 'sh' | 'ex' | 'shnb' | 'exnb' | 'un' -) => void; - import type { FileLockManager, RequestedRangeLock, @@ -13,43 +5,28 @@ import type { WholeFileLockOp, Pid, Fd, -} from '@php-wasm/universal'; - -type LockMode = 'exclusive' | 'shared' | 'unlock'; - -type NativeLock = { - fd: number; - mode: LockMode; - nativeFlockSync: NativeFlockSync; -}; - -type LockedRange = RequestedRangeLock & { - type: Exclude; -}; - -const MAX_64BIT_OFFSET = BigInt(2n ** 64n - 1n); +} from './file-lock-manager'; +import { MAX_ADDRESSABLE_FILE_OFFSET } from './file-lock-manager'; +import { + FileLockIntervalTree, + type LockedRange, +} from './file-lock-interval-tree'; /** * This is the file lock manager for use within JS runtimes like Node.js. * - * A FileLockManagerForNode is a wrapper around a Map of FileLock instances. + * A FileLockManagerInMemory is a wrapper around a Map of FileLock instances. * It provides methods for locking and unlocking files, as well as finding conflicting locks. */ -export class FileLockManagerForNode implements FileLockManager { - nativeFlockSync: NativeFlockSync; +export class FileLockManagerInMemory implements FileLockManager { locks: Map; /** - * Create a new FileLockManagerForNode instance. + * Create a new FileLockManagerInMemory instance. * * @param nativeFlockSync A synchronous flock() function to lock files via the host OS. */ - constructor( - nativeFlockSync: NativeFlockSync = function flockSyncNoOp() { - /* do nothing */ - } - ) { - this.nativeFlockSync = nativeFlockSync; + constructor() { this.locks = new Map(); } @@ -67,15 +44,7 @@ export class FileLockManagerForNode implements FileLockManager { return true; } - const maybeLock = FileLock.maybeCreate( - path, - op.type, - this.nativeFlockSync - ); - if (maybeLock === undefined) { - return false; - } - this.locks.set(path, maybeLock); + this.locks.set(path, new FileLock()); } const lock = this.locks.get(path)!; @@ -95,6 +64,8 @@ export class FileLockManagerForNode implements FileLockManager { lockFileByteRange( path: string, requestedLock: RequestedRangeLock + // TODO: Support waiting for locks. + // waitForLock: boolean ): boolean { if (!this.locks.has(path)) { if (requestedLock.type === 'unlocked') { @@ -102,15 +73,7 @@ export class FileLockManagerForNode implements FileLockManager { return true; } - const maybeLock = FileLock.maybeCreate( - path, - requestedLock.type, - this.nativeFlockSync - ); - if (maybeLock === undefined) { - return false; - } - this.locks.set(path, maybeLock); + this.locks.set(path, new FileLock()); } const lock = this.locks.get(path)!; return lock.lockFileByteRange(requestedLock); @@ -154,12 +117,12 @@ export class FileLockManagerForNode implements FileLockManager { * @param fd The file descriptor to release locks for. * @param path The path to the file to release locks for. */ - releaseLocksForProcessFd(pid: number, fd: number, nativePath: string) { + releaseLocksOnFdClose(pid: number, fd: number, nativePath: string) { const lock = this.locks.get(nativePath); if (!lock) { return; } - lock.releaseLocksForProcessFd(pid, fd); + lock.releaseLocksOnFdClose(pid, fd); this.forgetPathIfUnlocked(nativePath); } @@ -175,7 +138,6 @@ export class FileLockManagerForNode implements FileLockManager { } if (lock.isUnlocked()) { - lock.dispose(); this.locks.delete(path); } } @@ -191,67 +153,14 @@ export class FileLockManagerForNode implements FileLockManager { * not granted. */ export class FileLock { - /** - * Create a new FileLock instance for the given file and mode. - * Fail if the underlying native file lock cannot be acquired. - * - * @param path The path to the file to lock - * @param mode The type of lock to acquire - * @returns A FileLock instance if the lock was acquired, undefined otherwise - */ - static maybeCreate( - path: string, - mode: Exclude, - nativeFlockSync: NativeFlockSync - ): FileLock | undefined { - let fd; - try { - fd = openSync(path, 'a+'); - - const flockFlags = mode === 'exclusive' ? 'exnb' : 'shnb'; - nativeFlockSync(fd, flockFlags); - - const nativeLock: NativeLock = { fd, mode, nativeFlockSync }; - return new FileLock(nativeLock); - } catch { - if (fd !== undefined) { - try { - closeSync(fd); - } catch (error) { - logger.error( - 'Error closing locking file descriptor', - error - ); - } - } - return undefined; - } - } - - private nativeLock: NativeLock; private wholeFileLock: WholeFileLock; private rangeLocks: FileLockIntervalTree; - private constructor(nativeLock: NativeLock) { - this.nativeLock = nativeLock; + constructor() { this.rangeLocks = new FileLockIntervalTree(); this.wholeFileLock = { type: 'unlocked' }; } - /** - * Close the file descriptor and release the native lock. - * - * @TODO Replace this with a Symbol.dispose property once supported by all JS runtimes. - */ - dispose() { - try { - // Closing the file will release its lock - closeSync(this.nativeLock.fd); - } catch (error) { - logger.error('Error closing locking file descriptor', error); - } - } - /** * Lock the whole file. * @@ -286,13 +195,6 @@ export class FileLock { } } - // Make sure we only hold the minimum required native lock. - if (!this.ensureCompatibleNativeLock()) { - logger.error( - 'Unable to update native lock after removing a whole file lock.' - ); - } - return true; } @@ -301,16 +203,6 @@ export class FileLock { return false; } - if ( - !this.ensureCompatibleNativeLock({ - overrideWholeFileLockType: op.type, - }) - ) { - // We cannot acquire a native lock that is compatible with the requested lock. - // An external process may be holding a conflicting lock. - return false; - } - if (op.type === 'exclusive') { this.wholeFileLock = { type: 'exclusive', @@ -359,7 +251,7 @@ export class FileLock { */ requestedLock = { ...requestedLock, - end: MAX_64BIT_OFFSET, + end: MAX_ADDRESSABLE_FILE_OFFSET, }; } @@ -390,13 +282,6 @@ export class FileLock { } } - // Make sure we only hold the minimum required native lock. - if (!this.ensureCompatibleNativeLock()) { - logger.error( - 'Unable to update native lock after removing a byte range lock.' - ); - } - return true; } @@ -405,16 +290,6 @@ export class FileLock { return false; } - if ( - !this.ensureCompatibleNativeLock({ - overrideRangeLockType: requestedLock.type, - }) - ) { - // We cannot acquire a native lock that is compatible with the requested lock. - // An external process may be holding a conflicting lock. - return false; - } - const overlappingLocksFromSameProcess = this.rangeLocks .findOverlapping(requestedLock) .filter((lock) => lock.pid === requestedLock.pid); @@ -453,9 +328,7 @@ export class FileLock { * @param desiredLock The desired byte range lock. * @returns The first conflicting byte range lock, or undefined if no conflicting lock exists. */ - findFirstConflictingByteRangeLock( - desiredLock: RequestedRangeLock - ): RequestedRangeLock | undefined { + findFirstConflictingByteRangeLock(desiredLock: RequestedRangeLock) { const overlappingLocks = this.rangeLocks.findOverlapping(desiredLock); const firstConflictingRangeLock = overlappingLocks.find( (lock) => @@ -528,7 +401,7 @@ export class FileLock { * @param pid The process ID to release locks for. * @param fd The file descriptor to release locks for. */ - releaseLocksForProcessFd(pid: Pid, fd: Fd) { + releaseLocksOnFdClose(pid: Pid, fd: Fd) { // Closing an fd for a file releases all fcntl locks for that file by the process. // POSIX Ref: https://pubs.opengroup.org/onlinepubs/9799919799/functions/fcntl.html // "Closing a file descriptor shall release all locks held by the process on the file @@ -558,60 +431,6 @@ export class FileLock { ); } - /** - * Ensure that the native lock is compatible with the php-wasm lock, - * upgrading or downgrading as needed. - * - * @param overrideWholeFileLockType If provided, use this type for the whole file lock. - * @param overrideRangeLockType If provided, use this type for the range lock. - * @returns True if the native lock was upgraded or downgraded, false otherwise. - */ - private ensureCompatibleNativeLock({ - overrideWholeFileLockType, - overrideRangeLockType, - }: { - overrideWholeFileLockType?: WholeFileLock['type']; - overrideRangeLockType?: RequestedRangeLock['type']; - } = {}): boolean { - const wholeFileLockType = - overrideWholeFileLockType ?? this.wholeFileLock.type; - const rangeLockType = - overrideRangeLockType ?? - this.rangeLocks.findStrictestExistingLockType(); - - let requiredNativeLockType: NativeLock['mode']; - if ( - wholeFileLockType === 'exclusive' || - rangeLockType === 'exclusive' - ) { - requiredNativeLockType = 'exclusive'; - } else if ( - wholeFileLockType === 'shared' || - rangeLockType === 'shared' - ) { - requiredNativeLockType = 'shared'; - } else { - requiredNativeLockType = 'unlock'; - } - - if (this.nativeLock.mode === requiredNativeLockType) { - return true; - } - - const flockFlags = - (requiredNativeLockType === 'exclusive' && 'exnb') || - (requiredNativeLockType === 'shared' && 'shnb') || - 'un'; - - try { - this.nativeLock.nativeFlockSync(this.nativeLock.fd, flockFlags); - this.nativeLock.mode = requiredNativeLockType; - return true; - } catch { - return false; - } - } - /** * Check if a lock exists that conflicts with the requested range lock. * @@ -655,8 +474,9 @@ export class FileLock { const overlappingLocks = this.rangeLocks.findOverlapping({ type: 'unlocked', start: 0n, - end: MAX_64BIT_OFFSET, + end: MAX_ADDRESSABLE_FILE_OFFSET, pid: -1, + fd: -1, }); if (overlappingLocks.length > 0) { // Any range lock, including one by the same process, @@ -678,8 +498,9 @@ export class FileLock { const overlappingLocks = this.rangeLocks.findOverlapping({ type: 'unlocked', start: 0n, - end: MAX_64BIT_OFFSET, + end: MAX_ADDRESSABLE_FILE_OFFSET, pid: -1, + fd: -1, }); const exclusiveRangeLocks = overlappingLocks.filter( (lock) => lock.type === 'exclusive' @@ -696,215 +517,3 @@ export class FileLock { return false; } } - -class IntervalNode { - range: LockedRange; - max: bigint; - left: IntervalNode | null = null; - right: IntervalNode | null = null; - - constructor(range: LockedRange) { - this.range = range; - this.max = range.end; - } -} - -class FileLockIntervalTree { - private root: IntervalNode | null = null; - - isEmpty() { - return this.root === null; - } - - /** - * Insert a new locked range into the tree - */ - insert(range: LockedRange): void { - this.root = this.insertNode(this.root, range); - } - - /** - * Find all ranges that overlap with the given range - */ - findOverlapping(range: RequestedRangeLock): LockedRange[] { - const result: LockedRange[] = []; - this.findOverlappingRanges(this.root, range, result); - return result; - } - - /** - * Remove a lock range from the tree - */ - remove(range: RequestedRangeLock): void { - this.root = this.removeNode(this.root, range); - } - - /** - * Find all ranges locked by the given process. - * - * @param pid The process ID to find locks for. - * @returns All locked ranges for the given process. - */ - findLocksForProcess(pid: number): RequestedRangeLock[] { - const result: RequestedRangeLock[] = []; - this.findLocksForProcessInNode(this.root, pid, result); - return result; - } - - /** - * Find the strictest existing lock type in the range lock tree. - * - * @returns The strictest existing lock type, or 'unlocked' if no locks exist. - */ - findStrictestExistingLockType(): RequestedRangeLock['type'] { - let maxType: RequestedRangeLock['type'] = 'unlocked'; - - const traverse = (node: IntervalNode | null) => { - if (!node) { - return; - } - if (node.range.type === 'exclusive') { - maxType = 'exclusive'; - return; // Can stop early since exclusive is highest - } - if (node.range.type === 'shared') { - maxType = 'shared'; - } - traverse(node.left); - traverse(node.right); - }; - traverse(this.root); - - return maxType; - } - - private insertNode( - node: IntervalNode | null, - range: LockedRange - ): IntervalNode { - if (!node) { - return new IntervalNode(range); - } - - // Insert to left subtree if start is less than node's start - if (range.start < node.range.start) { - node.left = this.insertNode(node.left, range); - } else { - node.right = this.insertNode(node.right, range); - } - - // Update max value - node.max = this.bigintMax(node.max, range.end); - return node; - } - - private bigintMax(...args: bigint[]): bigint { - return args.reduce((max, current) => { - return current > max ? current : max; - }, args[0]); - } - - private findOverlappingRanges( - node: IntervalNode | null, - range: RequestedRangeLock, - result: LockedRange[] - ): void { - if (!node) { - return; - } - - // Check if current node overlaps - if (this.doRangesOverlap(node.range, range)) { - result.push(node.range); - } - - // If left child exists and its max is greater than range start, search left - if (node.left && node.left.max >= range.start) { - this.findOverlappingRanges(node.left, range, result); - } - - // Search right if it could contain overlapping intervals - if (node.right && node.range.start <= range.end) { - this.findOverlappingRanges(node.right, range, result); - } - } - - private doRangesOverlap( - a: RequestedRangeLock, - b: RequestedRangeLock - ): boolean { - return a.start < b.end && b.start < a.end; - } - - private removeNode( - node: IntervalNode | null, - range: RequestedRangeLock - ): IntervalNode | null { - if (!node) { - return null; - } - - // Check if current node is the one to remove - if (this.areRangesEqual(node.range, range)) { - // Handle cases of no children or one child - if (!node.left) { - return node.right; - } - if (!node.right) { - return node.left; - } - - // Node has two children - find successor - const successor = this.findMin(node.right); - node.range = successor.range; - node.right = this.removeNode(node.right, successor.range); - } else if (range.start < node.range.start) { - node.left = this.removeNode(node.left, range); - } else { - node.right = this.removeNode(node.right, range); - } - - // Update max value - node.max = node.range.end; - if (node.left) { - node.max = this.bigintMax(node.max, node.left.max); - } - if (node.right) { - node.max = this.bigintMax(node.max, node.right.max); - } - - return node; - } - - private findMin(node: IntervalNode): IntervalNode { - let current = node; - while (current.left) { - current = current.left; - } - return current; - } - - private areRangesEqual( - a: RequestedRangeLock, - b: RequestedRangeLock - ): boolean { - return a.start === b.start && a.end === b.end && a.pid === b.pid; - } - - private findLocksForProcessInNode( - node: IntervalNode | null, - pid: number, - result: RequestedRangeLock[] - ): void { - if (!node) { - return; - } - - if (node.range.pid === pid) { - result.push(node.range); - } - - this.findLocksForProcessInNode(node.left, pid, result); - this.findLocksForProcessInNode(node.right, pid, result); - } -} diff --git a/packages/php-wasm/universal/src/lib/file-lock-manager.ts b/packages/php-wasm/universal/src/lib/file-lock-manager.ts index 788598cb5c..62c421ebcf 100644 --- a/packages/php-wasm/universal/src/lib/file-lock-manager.ts +++ b/packages/php-wasm/universal/src/lib/file-lock-manager.ts @@ -1,3 +1,21 @@ +export const MAX_ADDRESSABLE_FILE_OFFSET = BigInt(Number.MAX_SAFE_INTEGER); +// TODO: Use this BigInt once the native fs-ext-extra-prebuilt package supports it. +//BigInt(2n ** 64n - 1n); + +/* + * NOTE: These types are not important structurally, + * but it helps clarity to use these aliases when making + * data structures based on them. + * + * For example, the type + * `Map>>` + * conveys more intention to a reader than + * `Map>>`. + */ +export type Path = string; +export type Pid = number; +export type Fd = number; + /** * This is an interface used to abstract byte range locking like fcntl() * and whole-file locking like flock(). @@ -14,7 +32,7 @@ export type FileLockManager = { * @param op - The operation to perform, including 'shared', 'exclusive', or 'unlock'. * @returns A promise for a boolean value. */ - lockWholeFile: (path: string, op: WholeFileLockOp) => boolean; + lockWholeFile: (path: Path, op: WholeFileLockOp) => boolean; /** * Update the lock on a byte range of a file. @@ -25,13 +43,15 @@ export type FileLockManager = { * @param path - The path of the file to lock. This should be the path of the file in the * underlying filesystem. * @param requestedLock - The lock to request, including start, end, type, and pid. + * @param waitForLock - Whether to block until the lock is acquired. * @returns A promise for a boolean value. * When locking: True if the lock was acquired, false if it was not. * When unlocking: Always true. */ lockFileByteRange: ( - path: string, - requestedLock: RequestedRangeLock + path: Path, + requestedLock: RequestedRangeLock, + waitForLock: boolean ) => boolean; /** @@ -47,7 +67,7 @@ export type FileLockManager = { * or undefined if there is no conflict. */ findFirstConflictingByteRangeLock: ( - path: string, + path: Path, desiredLock: RequestedRangeLock ) => Omit | undefined; @@ -68,12 +88,20 @@ export type FileLockManager = { * @param path The path to the file to release locks for. This should be the path * of the file in the underlying filesystem. */ - releaseLocksForProcessFd: (pid: number, fd: number, path: string) => void; + releaseLocksOnFdClose: (pid: number, fd: number, path: Path) => void; }; export type RequestedRangeLock = Readonly<{ - /** The type of lock request */ + /** + * The type of lock request + */ type: 'shared' | 'exclusive' | 'unlocked'; + /** + * The file descriptor to use. This should be the native file descriptor, + * not the Emscripten file descriptor because it may be used to lock the file + * using native OS file locking APIs. + */ + fd: Fd; /** The start offset of the lock range */ start: bigint; /** The end of the lock range */ @@ -87,9 +115,6 @@ export type WholeFileLock = Readonly< WholeFileLock_Exclusive | WholeFileLock_Shared | WholeFileLock_Unlocked >; -export type Pid = number; -export type Fd = number; - export type WholeFileLock_Exclusive = { type: 'exclusive'; pid: Pid; @@ -107,8 +132,16 @@ export type WholeFileLock_Unlocked = { type: 'unlocked'; }; -export type WholeFileLockOp = { - pid: number; - fd: number; - type: 'shared' | 'exclusive' | 'unlock'; -}; +export type WholeFileLockOp = + | { + pid: number; + fd: number; + type: 'shared' | 'exclusive'; + /** Whether to block until the lock is acquired. */ + waitForLock: boolean; + } + | { + pid: number; + fd: number; + type: 'unlock'; + }; diff --git a/packages/php-wasm/universal/src/lib/index.ts b/packages/php-wasm/universal/src/lib/index.ts index 65d48c28b4..762c8dc444 100644 --- a/packages/php-wasm/universal/src/lib/index.ts +++ b/packages/php-wasm/universal/src/lib/index.ts @@ -98,9 +98,13 @@ export { sandboxedSpawnHandlerFactory } from './sandboxed-spawn-handler-factory' export * from './api'; export type { WithAPIState as WithIsReady } from './api'; -export type * from './file-lock-manager'; +export * from './file-lock-manager'; +export * from './file-lock-manager-in-memory'; +export * from './file-lock-interval-tree'; // TODO: Review exported names and improve if needed. export * from './os-user-space'; export type * from './os-user-space'; export type { Remote } from './comlink-sync'; +export type { NodeProcess } from './comlink-node-process-adapter'; +export { releaseProxy as releaseRemoteApiProxy } from './comlink-sync'; diff --git a/packages/php-wasm/universal/src/lib/os-user-space.ts b/packages/php-wasm/universal/src/lib/os-user-space.ts index e79b2a9442..dadda5a3ea 100644 --- a/packages/php-wasm/universal/src/lib/os-user-space.ts +++ b/packages/php-wasm/universal/src/lib/os-user-space.ts @@ -1,4 +1,5 @@ -// TODO: Move file manager into kernel space. +// TODO: Document why we use the term "user space" for this file. +// TODO: Rename this module to php-wasm-user-space.ts. // TODO: Move FileLockManager into php-wasm/universal to resolve this import type { RequestedRangeLock, @@ -6,6 +7,7 @@ import type { WholeFileLockOp, } from './file-lock-manager'; import type { Emscripten } from './emscripten-types'; +// TODO: Rename this imported to php-wasm-kernel-space.ts. import type { OSKernelSpace } from './os-kernel-space'; type FSNode = Emscripten.FS.FSNode; @@ -129,7 +131,7 @@ export function bindUserSpace( LOCK_NB, LOCK_UN, }, - errnoCodes: { EBADF, EINVAL, EAGAIN, EDEADLK, EWOULDBLOCK }, + errnoCodes: { EBADF, EINVAL, EAGAIN, EWOULDBLOCK }, wasmImports: { builtin_fcntl64, builtin_fd_close, js_wasm_trace }, wasmExports: { wasm_get_end_offset }, syscalls: { getStreamFromFD }, @@ -160,15 +162,6 @@ export function bindUserSpace( type FcntlLockState = typeof F_RDLCK | typeof F_WRLCK | typeof F_UNLCK; const locking = { - /* - * This is a set of possibly locked file descriptors. - * - * When a file descriptor is closed, we need to release any associated held by this process. - * Instead of trying remember and forget file descriptors as they are locked and unlocked, - * we just track file descriptors we have locked before and try an unlock when they are closed. - */ - maybeLockedFds: new Set(), - lockStateToFcntl: { shared: F_RDLCK, exclusive: F_WRLCK, @@ -523,11 +516,15 @@ export function bindUserSpace( try { const nativeFilePath = locking.get_native_path_from_vfs_path(vfsPath); + const fdStream = getStreamFromFD(fd); + const conflictingLock = fileLockManager.findFirstConflictingByteRangeLock( nativeFilePath, { type: requestedLockType, + // TODO: Say why + fd: (fdStream as any).nfd as number, start: absoluteStartOffset, end: absoluteStartOffset + flockStruct.l_len, pid, @@ -582,8 +579,12 @@ export function bindUserSpace( } // @TODO: Implement a blocking version of F_SETLKW instead of // treating it the same as F_SETLK. - case F_SETLKW: - case F_SETLK: { + case F_SETLK: + case F_SETLKW: { + // TODO: Test both blocking and non-blocking modes in the integration tests. + // TODO: Make sure to return correct errno if waiting fails. EDEADLK may be the right errno. + const waitForLock = cmd === F_SETLKW; + js_wasm_trace('fcntl(%d, F_SETLK)', fd); const [vfsPath, vfsPathErrno] = locking.get_vfs_path_from_fd(fd); @@ -652,12 +653,14 @@ export function bindUserSpace( return -paramsCheckErrno; } - locking.maybeLockedFds.add(fd); + const fdStream = getStreamFromFD(fd); const requestedLockType = locking.fcntlToLockState[flockStruct.l_type]; const rangeLock: RequestedRangeLock = { type: requestedLockType, + // TODO: Can we improve the type checking story here? + fd: (fdStream as any).nfd as number, start: absoluteStartOffset, end: absoluteStartOffset + flockStruct.l_len, pid, @@ -675,7 +678,8 @@ export function bindUserSpace( const succeeded = fileLockManager.lockFileByteRange( nativeFilePath, - rangeLock + rangeLock, + waitForLock ); js_wasm_trace( @@ -728,10 +732,10 @@ export function bindUserSpace( } function flock(fd: number, op: number) { - js_wasm_trace('js_flock(%d, %d)', fd, op); + js_wasm_trace('flock(%d, %d)', fd, op); if (!fileLockManager) { js_wasm_trace( - 'js_flock(%d, %d) file lock manager is not available. ' + + 'flock(%d, %d) file lock manager is not available. ' + 'succeed by default as Emscripten does.', fd, op @@ -749,7 +753,7 @@ export function bindUserSpace( const [vfsPath, vfsPathErrno] = locking.get_vfs_path_from_fd(fd); if (vfsPathErrno !== 0) { js_wasm_trace( - 'js_flock(%d, %d) get_vfs_path_from_fd errno %d', + 'flock(%d, %d) get_vfs_path_from_fd errno %d', fd, op, vfsPath, @@ -773,7 +777,7 @@ export function bindUserSpace( const paramsCheckErrno = locking.check_lock_params(fd, op); if (paramsCheckErrno !== 0) { js_wasm_trace( - 'js_flock(%d, %d) %s check_lock_params errno %d', + 'flock(%d, %d) %s check_lock_params errno %d', fd, op, vfsPath, @@ -782,55 +786,43 @@ export function bindUserSpace( return -paramsCheckErrno; } - // @TODO: Consider supporting blocking mode of flock() - if ((op & LOCK_NB) === 0) { - js_wasm_trace( - 'js_flock(%d, %d) blocking mode of flock() is not implemented', - fd, - op - ); - // We do not yet support the blocking form of flock(). - // We respond with EINVAL to indicate failure - // because it is a known errno for a failed blocking flock(). - // return -EINVAL; - // TODO: Implement blocking mode of flock() - return 0; - } - const maskedOp = op & ((LOCK_SH | LOCK_EX | LOCK_UN) as FlockOp | 0); if (maskedOp === 0) { - js_wasm_trace('js_flock(%d, %d) invalid flock() operation', fd, op); + js_wasm_trace('flock(%d, %d) invalid flock() operation', fd, op); return -EINVAL; } const lockOpType = flockToLockOpType[maskedOp as FlockOp]; if (lockOpType === undefined) { - js_wasm_trace('js_flock(%d, %d) invalid flock() operation', fd, op); + js_wasm_trace('flock(%d, %d) invalid flock() operation', fd, op); return -EINVAL; } try { const nativeFilePath = locking.get_native_path_from_vfs_path(vfsPath); + const fdStream = getStreamFromFD(fd); + // TODO: Test both blocking and non-blocking modes in the integration tests. + // TODO: Make sure to return correct errno if waiting fails. EDEADLK may be the right errno. + const waitForLock = (op & LOCK_NB) === 0; const succeeded = fileLockManager.lockWholeFile(nativeFilePath, { type: lockOpType, pid: pid, - fd, + // TODO: Say why + fd: (fdStream as any).nfd as number, + waitForLock, }); js_wasm_trace( - 'js_flock(%d, %d) lockWholeFile %s returned %d', + 'flock(%d, %d) lockWholeFile %s returned %d', fd, op, vfsPath, succeeded ); - if (succeeded) { - locking.maybeLockedFds.add(fd); - } return succeeded ? 0 : -EWOULDBLOCK; } catch (e) { - js_wasm_trace('js_flock(%d, %d) lockWholeFile error %s', fd, op, e); + js_wasm_trace('flock(%d, %d) lockWholeFile error %s', fd, op, e); return -EINVAL; } } @@ -850,59 +842,40 @@ export function bindUserSpace( const [vfsPath, vfsPathResolutionErrno] = locking.get_vfs_path_from_fd(fd); - const fdCloseResult = builtin_fd_close(fd); - if (fdCloseResult !== 0) { - js_wasm_trace( - 'fd_close(%d) %s result %d', - fd, - vfsPath, - fdCloseResult - ); - return fdCloseResult; - } - if (!locking.maybeLockedFds.has(fd)) { - js_wasm_trace( - 'fd_close(%d) not in maybe-locked-list %s result %d', - fd, - vfsPath, - fdCloseResult - ); - return fdCloseResult; - } - if (vfsPathResolutionErrno !== 0) { js_wasm_trace( 'fd_close(%d) get_vfs_path_from_fd error %d', fd, vfsPathResolutionErrno ); - /* - * It looks like the file may have had an associated lock, - * but since we cannot look up the path, - * there is nothing more for us to do. - * - * NOTE: This seems possible for files that are locked and - * then unlinked before close. It is an opportunity for a - * lock to be orphaned in the lock manager. - * @TODO: Explore how to ensure cleanup in this case. - */ - return fdCloseResult; } - if (!locking.is_path_to_shared_fs(vfsPath)) { - return fdCloseResult; + if ( + vfsPathResolutionErrno === 0 && + locking.is_path_to_shared_fs(vfsPath) + ) { + try { + const fdStream = getStreamFromFD(fd); + js_wasm_trace('fd_close(%d) %s release locks', fd, vfsPath); + const nativeFilePath = + locking.get_native_path_from_vfs_path(vfsPath); + fileLockManager.releaseLocksOnFdClose( + pid, + // TODO: Say why + (fdStream as any).nfd as number, + nativeFilePath + ); + js_wasm_trace( + 'fd_close(%d) %s release locks success', + fd, + vfsPath + ); + } catch (e) { + js_wasm_trace("fd_close(%d) %s error '%s'", fd, vfsPath, e); + } } - try { - js_wasm_trace('fd_close(%d) %s release locks', fd, vfsPath); - const nativeFilePath = - locking.get_native_path_from_vfs_path(vfsPath); - fileLockManager.releaseLocksForProcessFd(pid, fd, nativeFilePath); - js_wasm_trace('fd_close(%d) %s release locks success', fd, vfsPath); - } catch (e) { - js_wasm_trace("fd_close(%d) %s error '%s'", fd, vfsPath, e); - } - return fdCloseResult; + return builtin_fd_close(fd); } // TODO: Implement based on current process diff --git a/packages/playground/cli/src/blueprints-v1/blueprints-v1-handler.ts b/packages/playground/cli/src/blueprints-v1/blueprints-v1-handler.ts index 1f4380dafc..812a59e148 100644 --- a/packages/playground/cli/src/blueprints-v1/blueprints-v1-handler.ts +++ b/packages/playground/cli/src/blueprints-v1/blueprints-v1-handler.ts @@ -1,4 +1,6 @@ import { logger } from '@php-wasm/logger'; +// TODO: Wire up download progress tracking with initial worker +// eslint-disable-next-line @typescript-eslint/no-unused-vars import { EmscriptenDownloadMonitor, ProgressTracker } from '@php-wasm/progress'; import { consumeAPI } from '@php-wasm/universal'; import type { BlueprintV1Declaration } from '@wp-playground/blueprints'; @@ -7,25 +9,24 @@ import { isBlueprintBundle, resolveRuntimeConfiguration, } from '@wp-playground/blueprints'; -import { RecommendedPHPVersion, zipDirectory } from '@wp-playground/common'; -import fs from 'fs'; -import path from 'path'; -import { resolveWordPressRelease } from '@wp-playground/wordpress'; -import { - CACHE_FOLDER, - cachedDownload, - fetchSqliteIntegration, - readAsFile, -} from './download'; +import { RecommendedPHPVersion } from '@wp-playground/common'; import type { PlaygroundCliBlueprintV1Worker } from './worker-thread-v1'; -import type { MessagePort as NodeMessagePort } from 'worker_threads'; import { LogVerbosity, - type RunCLIArgs, type SpawnedWorker, + type RunCLIArgs, type WorkerType, } from '../run-cli'; import { shouldRenderProgress } from '../utils/progress'; +import { resolveWordPressRelease } from '@wp-playground/wordpress'; +import { + CACHE_FOLDER, + cachedDownload, + fetchSqliteIntegration, + readAsFile, +} from './download'; +import path from 'path'; +import fs from 'fs'; /** * Boots Playground CLI workers using Blueprint version 1. @@ -57,8 +58,7 @@ export class BlueprintsV1Handler { } async bootAndSetUpInitialPlayground( - phpPort: NodeMessagePort, - fileLockManagerPort: NodeMessagePort, + workerProcess: SpawnedWorker, nativeInternalDirPath: string ) { let wpDetails: any = undefined; @@ -124,7 +124,12 @@ export class BlueprintsV1Handler { const mountsBeforeWpInstall = this.args['mount-before-install'] || []; const mountsAfterWpInstall = this.args.mount || []; - const playground = consumeAPI(phpPort); + // TODO: Fix this type error. + // @ts-ignore + const playground = + // TODO: Fix this type error. + // @ts-ignore + consumeAPI(workerProcess); // Comlink communication proxy await playground.isConnected(); @@ -135,16 +140,15 @@ export class BlueprintsV1Handler { this.getEffectiveBlueprint() ); - await playground.useFileLockManager(fileLockManagerPort); await playground.bootAndSetUpInitialWorker({ + port: this.args.port!, phpVersion: runtimeConfiguration.phpVersion, - wpVersion: runtimeConfiguration.wpVersion, siteUrl: this.siteUrl, mountsBeforeWpInstall, mountsAfterWpInstall, wordpressInstallMode: this.args.wordpressInstallMode || 'download-and-install', - wordPressZip: wordPressZip && (await wordPressZip!.arrayBuffer()), + wordPressZip: await wordPressZip?.arrayBuffer(), sqliteIntegrationPluginZip: await sqliteIntegrationPluginZip?.arrayBuffer(), firstProcessId: 0, @@ -161,43 +165,30 @@ export class BlueprintsV1Handler { nativeInternalDirPath, }); - if ( - preinstalledWpContentPath && - !this.args['mount-before-install'] && - !fs.existsSync(preinstalledWpContentPath) - ) { - logger.log(`Caching preinstalled WordPress for the next boot...`); - fs.writeFileSync( - preinstalledWpContentPath, - (await zipDirectory(playground, '/wordpress'))! - ); - logger.log(`Cached!`); - } - return playground; } async bootPlayground({ - worker, - fileLockManagerPort, + workerProcess, firstProcessId, nativeInternalDirPath, }: { - worker: SpawnedWorker; - fileLockManagerPort: NodeMessagePort; + workerProcess: SpawnedWorker; firstProcessId: number; nativeInternalDirPath: string; }) { const playground = consumeAPI( - worker.phpPort + // TODO: Fix this type error. + // @ts-ignore + workerProcess ); await playground.isConnected(); const runtimeConfiguration = await resolveRuntimeConfiguration( this.getEffectiveBlueprint() ); - await playground.useFileLockManager(fileLockManagerPort); await playground.bootWorker({ + port: this.args.port!, phpVersion: runtimeConfiguration.phpVersion, siteUrl: this.siteUrl, mountsBeforeWpInstall: this.args['mount-before-install'] || [], diff --git a/packages/playground/cli/src/blueprints-v1/worker-thread-v1.ts b/packages/playground/cli/src/blueprints-v1/worker-thread-v1.ts index aa9ac5e763..4245cceb45 100644 --- a/packages/playground/cli/src/blueprints-v1/worker-thread-v1.ts +++ b/packages/playground/cli/src/blueprints-v1/worker-thread-v1.ts @@ -1,10 +1,14 @@ -import type { FileLockManager } from '@php-wasm/universal'; +// TODO: Rename this file to worker-process-v1.ts import { loadNodeRuntime } from '@php-wasm/node'; import { EmscriptenDownloadMonitor } from '@php-wasm/progress'; -import type { SupportedPHPVersion } from '@php-wasm/universal'; +import type { + NodeProcess, + PHPRequest, + SupportedPHPVersion, +} from '@php-wasm/universal'; import { PHPWorker, - consumeAPISync, + consumeAPI, exposeAPI, sandboxedSpawnHandlerFactory, } from '@php-wasm/universal'; @@ -16,16 +20,18 @@ import { bootWordPressAndRequestHandler, } from '@wp-playground/wordpress'; import { rootCertificates } from 'tls'; -import { MessageChannel, type MessagePort, parentPort } from 'worker_threads'; import { mountResources } from '../mounts'; import { logger } from '@php-wasm/logger'; -import { spawnWorkerThread } from '../run-cli'; +import { killWorkerProcess, spawnWorkerProcess } from '../run-cli'; +import { startServer } from '../start-server'; import type { Mount } from '@php-wasm/cli-util'; +import cluster from 'cluster'; export type WorkerBootOptions = { phpVersion: SupportedPHPVersion; siteUrl: string; + port: number; mountsBeforeWpInstall: Array; mountsAfterWpInstall: Array; firstProcessId: number; @@ -47,13 +53,13 @@ export type WorkerBootOptions = { export type PrimaryWorkerBootOptions = WorkerBootOptions & { wordpressInstallMode: WordPressInstallMode; - wpVersion?: string; wordPressZip?: ArrayBuffer; sqliteIntegrationPluginZip?: ArrayBuffer; dataSqlPath?: string; }; interface WorkerBootRequestHandlerOptions { + port: number; siteUrl: string; followSymlinks: boolean; phpVersion: SupportedPHPVersion; @@ -85,35 +91,14 @@ function tracePhpWasm(processId: number, format: string, ...args: any[]) { export class PlaygroundCliBlueprintV1Worker extends PHPWorker { booted = false; - fileLockManager: FileLockManager | undefined; constructor(monitor: EmscriptenDownloadMonitor) { super(undefined, monitor); } - /** - * Call this method before boot() to use file locking. - * - * This method is separate from boot() to simplify the related Comlink.transferHandlers - * setup – if an argument is a MessagePort, we're transferring it, not copying it. - * - * @see comlink-sync.ts - * @see phpwasm-emscripten-library-file-locking-for-node.js - */ - async useFileLockManager(port: MessagePort) { - /** - * If JSPI is not available, php.js only supports synchronous locking syscalls. - * Let's use the synchronous API. Every method call will block this thread - * until the result is available. - * - * @see comlink-sync.ts - * @see phpwasm-emscripten-library-file-locking-for-node.js - */ - this.fileLockManager = await consumeAPISync(port); - } - async bootAndSetUpInitialWorker(options: PrimaryWorkerBootOptions) { const { + port, siteUrl, mountsBeforeWpInstall, mountsAfterWpInstall, @@ -138,10 +123,7 @@ export class PlaygroundCliBlueprintV1Worker extends PHPWorker { let wordpressBooted = false; const requestHandler = await bootWordPressAndRequestHandler({ siteUrl, - createPhpRuntime: createPhpRuntimeFactory( - options, - this.fileLockManager! - ), + createPhpRuntime: createPhpRuntimeFactory(options), wordpressInstallMode, wordPressZip: wordPressZip !== undefined @@ -169,7 +151,7 @@ export class PlaygroundCliBlueprintV1Worker extends PHPWorker { dataSqlPath, spawnHandler: () => sandboxedSpawnHandlerFactory(() => - createPHPWorker(options, this.fileLockManager!) + createPHPWorker(options) ), async onPHPInstanceCreated(php) { await mountResources(php, mountsBeforeWpInstall); @@ -190,6 +172,14 @@ export class PlaygroundCliBlueprintV1Worker extends PHPWorker { // these mounts automatically. await mountResources(primaryPhp, mountsAfterWpInstall); + if (cluster.isWorker) { + await startServer({ + port, + handleRequest: async (request: PHPRequest) => { + return await this.request(request); + }, + }); + } setApiReady(); } catch (e) { setAPIError(e as Error); @@ -197,10 +187,6 @@ export class PlaygroundCliBlueprintV1Worker extends PHPWorker { } } - async hello() { - return 'hello'; - } - async bootWorker(args: WorkerBootOptions) { await this.bootRequestHandler(args); } @@ -214,10 +200,7 @@ export class PlaygroundCliBlueprintV1Worker extends PHPWorker { try { const requestHandler = await bootRequestHandler({ siteUrl: options.siteUrl, - createPhpRuntime: createPhpRuntimeFactory( - options, - this.fileLockManager! - ), + createPhpRuntime: createPhpRuntimeFactory(options), onPHPInstanceCreated: async (php) => { await mountResources(php, options.mountsBeforeWpInstall); await mountResources(php, options.mountsAfterWpInstall); @@ -226,14 +209,24 @@ export class PlaygroundCliBlueprintV1Worker extends PHPWorker { cookieStore: false, spawnHandler: () => sandboxedSpawnHandlerFactory(() => - createPHPWorker(options, this.fileLockManager!) + createPHPWorker(options) ), + maxPhpInstances: 1, }); this.__internal_setRequestHandler(requestHandler); const primaryPhp = await requestHandler.getPrimaryPhp(); await this.setPrimaryPHP(primaryPhp); + if (cluster.isWorker) { + await startServer({ + port: options.port, + handleRequest: async (request: PHPRequest) => { + return await this.request(request); + }, + }); + } + setApiReady(); } catch (e) { setAPIError(e as Error); @@ -251,10 +244,7 @@ export class PlaygroundCliBlueprintV1Worker extends PHPWorker { * Returns a factory function that starts a new PHP runtime in the currently * running process. This is used for rotating the PHP runtime periodically. */ -function createPhpRuntimeFactory( - options: WorkerBootRequestHandlerOptions, - fileLockManager: FileLockManager | RemoteAPI -) { +function createPhpRuntimeFactory(options: WorkerBootRequestHandlerOptions) { let nextProcessId = options.firstProcessId; const lastProcessId = options.firstProcessId + options.processIdSpaceLength - 1; @@ -271,13 +261,10 @@ function createPhpRuntimeFactory( return await loadNodeRuntime( options.phpVersion || RecommendedPHPVersion, { - fileLockManager, emscriptenOptions: { processId, trace: options.trace ? tracePhpWasm : undefined, - phpWasmInitOptions: { - nativeInternalDirPath: options.nativeInternalDirPath, - }, + nativeInternalDirPath: options.nativeInternalDirPath, }, followSymlinks: options.followSymlinks, withIntl: options.withIntl, @@ -301,31 +288,28 @@ function createPhpRuntimeFactory( * any locks that overlap between PHP instances conflict with each other as expected. * * @param options - The options for the worker. - * @param fileLockManager - The file lock manager to use. * @returns A promise that resolves to the PHP worker. */ -async function createPHPWorker( - options: WorkerBootRequestHandlerOptions, - fileLockManager: FileLockManager | RemoteAPI -) { - const spawnedWorker = await spawnWorkerThread('v1'); +async function createPHPWorker(options: WorkerBootRequestHandlerOptions) { + const spawnedWorker = await spawnWorkerProcess('v1'); const handler = consumeAPI( - spawnedWorker.phpPort + // TODO: Fix this type error. + // @ts-ignore + spawnedWorker ); - handler.useFileLockManager(fileLockManager as any); await handler.bootWorker(options); return { php: handler, - reap: () => { + reap: async () => { try { handler.dispose(); } catch { /** */ } try { - spawnedWorker.worker.terminate(); + await killWorkerProcess(spawnedWorker); } catch { /** */ } @@ -337,18 +321,12 @@ process.on('unhandledRejection', (e: any) => { logger.error('Unhandled rejection:', e); }); -const phpChannel = new MessageChannel(); - const [setApiReady, setAPIError] = exposeAPI( new PlaygroundCliBlueprintV1Worker(new EmscriptenDownloadMonitor()), undefined, - phpChannel.port1 + // TODO: Fix this type error. + // @ts-ignore + process as NodeProcess ); -parentPort?.postMessage( - { - command: 'worker-script-initialized', - phpPort: phpChannel.port2, - }, - [phpChannel.port2 as any] -); +process.send!({ command: 'worker-script-initialized' }); diff --git a/packages/playground/cli/src/blueprints-v2/blueprints-v2-handler.ts b/packages/playground/cli/src/blueprints-v2/blueprints-v2-handler.ts index b1ffffd1ff..3c45df0bc3 100644 --- a/packages/playground/cli/src/blueprints-v2/blueprints-v2-handler.ts +++ b/packages/playground/cli/src/blueprints-v2/blueprints-v2-handler.ts @@ -4,7 +4,6 @@ import type { PlaygroundCliBlueprintV2Worker, SecondaryWorkerBootArgs, } from './worker-thread-v2'; -import type { MessagePort as NodeMessagePort } from 'worker_threads'; import type { RunCLIArgs, SpawnedWorker, WorkerType } from '../run-cli'; import { shouldRenderProgress } from '../utils/progress'; @@ -40,14 +39,13 @@ export class BlueprintsV2Handler { } async bootAndSetUpInitialPlayground( - phpPort: NodeMessagePort, - fileLockManagerPort: NodeMessagePort, + workerProcess: SpawnedWorker, nativeInternalDirPath: string ) { const playground: RemoteAPI = - consumeAPI(phpPort); - - await playground.useFileLockManager(fileLockManagerPort); + // TODO: Fix this type error. + // @ts-ignore + consumeAPI(workerProcess); const workerBootArgs = { ...this.args, @@ -74,20 +72,18 @@ export class BlueprintsV2Handler { } async bootPlayground({ - worker, - fileLockManagerPort, + workerProcess, firstProcessId, nativeInternalDirPath, }: { - worker: SpawnedWorker; - fileLockManagerPort: NodeMessagePort; + workerProcess: SpawnedWorker; firstProcessId: number; nativeInternalDirPath: string; }) { const playground: RemoteAPI = - consumeAPI(worker.phpPort); - - await playground.useFileLockManager(fileLockManagerPort); + // TODO: Fix this type error. + // @ts-ignore + consumeAPI(workerProcess); const workerBootArgs: SecondaryWorkerBootArgs = { ...this.args, diff --git a/packages/playground/cli/src/blueprints-v2/worker-thread-v2.ts b/packages/playground/cli/src/blueprints-v2/worker-thread-v2.ts index 5a80c16c71..4ad9b98a37 100644 --- a/packages/playground/cli/src/blueprints-v2/worker-thread-v2.ts +++ b/packages/playground/cli/src/blueprints-v2/worker-thread-v2.ts @@ -1,11 +1,10 @@ +// TODO: Rename this file to worker-process-v2.ts import { errorLogPath, logger } from '@php-wasm/logger'; -import type { FileLockManager } from '@php-wasm/universal'; import { createNodeFsMountHandler, loadNodeRuntime } from '@php-wasm/node'; import { EmscriptenDownloadMonitor } from '@php-wasm/progress'; import type { PHP, FileTree, - RemoteAPI, SupportedPHPVersion, SpawnHandler, } from '@php-wasm/universal'; @@ -13,7 +12,7 @@ import { PHPExecutionFailureError, PHPResponse, PHPWorker, - consumeAPISync, + consumeAPI, exposeAPI, sandboxedSpawnHandlerFactory, } from '@php-wasm/universal'; @@ -31,8 +30,12 @@ import { bootRequestHandler } from '@wp-playground/wordpress'; import { existsSync } from 'fs'; import path from 'path'; import { rootCertificates } from 'tls'; -import { MessageChannel, type MessagePort, parentPort } from 'worker_threads'; -import { spawnWorkerThread, type RunCLIArgs } from '../run-cli'; +import { MessageChannel, parentPort } from 'worker_threads'; +import { + killWorkerProcess, + spawnWorkerProcess, + type RunCLIArgs, +} from '../run-cli'; import type { PhpIniOptions, PHPInstanceCreatedHook, @@ -180,33 +183,11 @@ export class PlaygroundCliBlueprintV2Worker extends PHPWorker { booted = false; blueprintTargetResolved = false; phpInstancesThatNeedMountsAfterTargetResolved = new Set(); - fileLockManager: FileLockManager | undefined; constructor(monitor: EmscriptenDownloadMonitor) { super(undefined, monitor); } - /** - * Call this method before boot() to use file locking. - * - * This method is separate from boot() to simplify the related Comlink.transferHandlers - * setup – if an argument is a MessagePort, we're transferring it, not copying it. - * - * @see comlink-sync.ts - * @see phpwasm-emscripten-library-file-locking-for-node.js - */ - async useFileLockManager(port: MessagePort) { - /** - * If JSPI is not available, php.js only supports synchronous locking syscalls. - * Let's use the synchronous API. Every method call will block this thread - * until the result is available. - * - * @see comlink-sync.ts - * @see phpwasm-emscripten-library-file-locking-for-node.js - */ - this.fileLockManager = await consumeAPISync(port); - } - async bootAndSetUpInitialWorker(args: PrimaryWorkerBootArgs) { const constants = { WP_DEBUG: true, @@ -243,9 +224,7 @@ export class PlaygroundCliBlueprintV2Worker extends PHPWorker { } }, spawnHandler: () => - sandboxedSpawnHandlerFactory(() => - createPHPWorker(args, this.fileLockManager!) - ), + sandboxedSpawnHandlerFactory(() => createPHPWorker(args)), }; await this.bootRequestHandler(requestHandlerOptions); @@ -295,9 +274,7 @@ export class PlaygroundCliBlueprintV2Worker extends PHPWorker { } }, spawnHandler: () => - sandboxedSpawnHandlerFactory(() => - createPHPWorker(args, this.fileLockManager!) - ), + sandboxedSpawnHandlerFactory(() => createPHPWorker(args)), }); } @@ -488,7 +465,6 @@ export class PlaygroundCliBlueprintV2Worker extends PHPWorker { } return await loadNodeRuntime(phpVersion, { - fileLockManager: this.fileLockManager!, emscriptenOptions: { processId, trace: trace ? tracePhpWasm : undefined, @@ -543,33 +519,30 @@ export class PlaygroundCliBlueprintV2Worker extends PHPWorker { * any locks that overlap between PHP instances conflict with each other as expected. * * @param options - The options for the worker. - * @param fileLockManager - The file lock manager to use. * @returns A promise that resolves to the PHP worker. */ -async function createPHPWorker( - { - siteUrl, - allow, - phpVersion, - createFiles, - constants, - phpIniEntries, - firstProcessId, - processIdSpaceLength, - trace, - nativeInternalDirPath, - withXdebug, - mountsBeforeWpInstall, - mountsAfterWpInstall, - }: SecondaryWorkerBootArgs, - fileLockManager: FileLockManager | RemoteAPI -) { - const spawnedWorker = await spawnWorkerThread('v2'); +async function createPHPWorker({ + siteUrl, + allow, + phpVersion, + createFiles, + constants, + phpIniEntries, + firstProcessId, + processIdSpaceLength, + trace, + nativeInternalDirPath, + withXdebug, + mountsBeforeWpInstall, + mountsAfterWpInstall, +}: SecondaryWorkerBootArgs) { + const spawnedWorkerProcess = await spawnWorkerProcess('v2'); const handler = consumeAPI( - spawnedWorker.phpPort + // TODO: Fix this type error. + // @ts-ignore + spawnedWorkerProcess ); - handler.useFileLockManager(fileLockManager as any); await handler.bootWorker({ siteUrl, allow, @@ -588,14 +561,14 @@ async function createPHPWorker( return { php: handler, - reap: () => { + reap: async () => { try { handler.dispose(); } catch { /** */ } try { - spawnedWorker.worker.terminate(); + await killWorkerProcess(spawnedWorkerProcess); } catch { /** */ } diff --git a/packages/playground/cli/src/run-cli.ts b/packages/playground/cli/src/run-cli.ts index 6ba8c0492e..8c13b21000 100644 --- a/packages/playground/cli/src/run-cli.ts +++ b/packages/playground/cli/src/run-cli.ts @@ -1,15 +1,10 @@ import { errorLogPath, logger, LogSeverity } from '@php-wasm/logger'; import type { - PHPRequest, RemoteAPI, SupportedPHPVersion, UniversalPHP, } from '@php-wasm/universal'; -import { - PHPResponse, - exposeSyncAPI, - printDebugDetails, -} from '@php-wasm/universal'; +import { printDebugDetails, releaseRemoteApiProxy } from '@php-wasm/universal'; import type { BlueprintBundle, BlueprintV1Declaration, @@ -18,23 +13,17 @@ import type { import { runBlueprintV1Steps } from '@wp-playground/blueprints'; import { RecommendedPHPVersion } from '@wp-playground/common'; import fs, { mkdirSync } from 'fs'; -import type { Server } from 'http'; -import { MessageChannel as NodeMessageChannel, Worker } from 'worker_threads'; // @ts-ignore import { expandAutoMounts, parseMountDirArguments, parseMountWithDelimiterArguments, } from './mounts'; -import { startServer } from './start-server'; import type { PlaygroundCliBlueprintV1Worker } from './blueprints-v1/worker-thread-v1'; import type { PlaygroundCliBlueprintV2Worker } from './blueprints-v2/worker-thread-v2'; -import { FileLockManagerForNode } from '@php-wasm/node'; -import { LoadBalancer } from './load-balancer'; /* eslint-disable no-console */ import { SupportedPHPVersions } from '@php-wasm/universal'; import { cpus } from 'os'; -import type { MessagePort as NodeMessagePort } from 'worker_threads'; import yargs from 'yargs'; import { isValidWordPressSlug } from './is-valid-wordpress-slug'; import { resolveBlueprint } from './resolve-blueprint'; @@ -42,7 +31,6 @@ import { BlueprintsV2Handler } from './blueprints-v2/blueprints-v2-handler'; import { BlueprintsV1Handler } from './blueprints-v1/blueprints-v1-handler'; import { startBridge } from '@php-wasm/xdebug-bridge'; import path from 'path'; -import os from 'os'; import { cleanupStalePlaygroundTempDirs, createPlaygroundCliTempDir, @@ -55,6 +43,9 @@ import { createTempDirSymlink, removeTempDirSymlink, } from '@php-wasm/cli-util'; +import cluster, { type Worker as ClusterProcess } from 'cluster'; +import childProcess, { type ChildProcess } from 'child_process'; +import { fileURLToPath } from 'url'; // Inlined worker URLs for static analysis by downstream bundlers // These are replaced at build time by the Vite plugin in vite.config.ts @@ -543,7 +534,6 @@ export const internalsKeyForTesting = Symbol('playground-cli-testing'); export interface RunCLIServer extends AsyncDisposable { playground: RemoteAPI; - server: Server; serverUrl: string; [Symbol.asyncDispose](): Promise; @@ -578,14 +568,17 @@ export async function runCLI( ): Promise; export async function runCLI(args: RunCLIArgs): Promise; export async function runCLI(args: RunCLIArgs): Promise { - let loadBalancer: LoadBalancer; - let playground: RemoteAPI; + let playground: RemoteAPI | null = null; const playgroundsToCleanUp: Map< - Worker, + SpawnedWorker, RemoteAPI > = new Map(); + if (args.port === undefined) { + args.port = 9400; + } + /** * Expand auto-mounts to include the necessary mounts and steps * when running in auto-mount mode. @@ -631,520 +624,460 @@ export async function runCLI(args: RunCLIArgs): Promise { args.intl = true; } - // Declare file lock manager outside scope of startServer - // so we can look at it when debugging request handling. - const nativeFlockSync = - os.platform() === 'win32' - ? // @TODO: Enable fs-ext here when it works with Windows. - undefined - : await import('fs-ext') - .then((m) => m.flockSync) - .catch(() => { - logger.warn( - 'The fs-ext package is not installed. ' + - 'Internal file locking will not be integrated with ' + - 'host OS file locking.' - ); - return undefined; - }); - const fileLockManager = new FileLockManagerForNode(nativeFlockSync); - - let wordPressReady = false; - let isFirstRequest = true; - logger.log('Starting a PHP server...'); + const host = '127.0.0.1'; + const serverUrl = `http://${host}:${args['port'] as number}`; + const siteUrl = args['site-url'] || serverUrl; + + const targetWorkerCount = + args.command === 'server' ? (args.experimentalMultiWorker ?? 1) : 1; + const totalWorkersToSpawn = + args.command === 'server' + ? // Account for the initial worker which is discarded by the server after setup. + targetWorkerCount + 1 + : targetWorkerCount; + + // Process IDs appear to be defined as `int` in Emscripten: + // https://github.com/emscripten-core/emscripten/blob/95d2bf9c5c27b88ab7de6eba2d8e61ea1af977ac/system/lib/libc/musl/arch/emscripten/bits/alltypes.h#L290 + // and those are typically 32 bits wide in both 32-bit and 64-bit systems. + // Apparently, this is a signed type, so we cannot use the leftmost bit. + const maxValueForSigned32BitInteger = 2 ** (32 - 1) - 1; + const maxProcessIdValue = maxValueForSigned32BitInteger; + const processIdSpaceLength = Math.floor( + maxProcessIdValue / totalWorkersToSpawn + ); + + /* + * Use a real temp dir as a target for the following Playground paths + * so that multiple worker threads can share the same files. + * - /internal + * - /tmp + * - /wordpress + * + * Sharing the same files leads to faster boot times and uses less memory + * because we don't have to create or maintain multiple copies of the same files. + */ + const tempDirNameDelimiter = '-playground-cli-site-'; + const nativeDir = await createPlaygroundCliTempDir(tempDirNameDelimiter); + logger.debug(`Native temp dir for VFS root: ${nativeDir.path}`); + + const IDEConfigName = 'WP Playground CLI - Listen for Xdebug'; + + // Always clean up any existing Playground files symlink in the project root. + const symlinkName = '.playground-xdebug-root'; + const symlinkPath = path.join(process.cwd(), symlinkName); + + await removeTempDirSymlink(symlinkPath); + + // Then, if xdebug, and experimental IDE are enabled, + // recreate the symlink pointing to the temporary + // directory and add the new IDE config. + if (args.xdebug && args.experimentalUnsafeIdeIntegration) { + await createTempDirSymlink( + nativeDir.path, + symlinkPath, + process.platform + ); - return startServer({ - port: args['port'] as number, - onBind: async (server: Server, port: number) => { - const host = '127.0.0.1'; - const serverUrl = `http://${host}:${port}`; - const siteUrl = args['site-url'] || serverUrl; - - const targetWorkerCount = - args.command === 'server' - ? (args.experimentalMultiWorker ?? 1) - : 1; - const totalWorkersToSpawn = - args.command === 'server' - ? // Account for the initial worker which is discarded by the server after setup. - targetWorkerCount + 1 - : targetWorkerCount; - - // Process IDs appear to be defined as `int` in Emscripten: - // https://github.com/emscripten-core/emscripten/blob/95d2bf9c5c27b88ab7de6eba2d8e61ea1af977ac/system/lib/libc/musl/arch/emscripten/bits/alltypes.h#L290 - // and those are typically 32 bits wide in both 32-bit and 64-bit systems. - // Apparently, this is a signed type, so we cannot use the leftmost bit. - const maxValueForSigned32BitInteger = 2 ** (32 - 1) - 1; - const maxProcessIdValue = maxValueForSigned32BitInteger; - const processIdSpaceLength = Math.floor( - maxProcessIdValue / totalWorkersToSpawn - ); + const symlinkMount: Mount = { + hostPath: path.join('.', path.sep, symlinkName), + vfsPath: '/', + }; - /* - * Use a real temp dir as a target for the following Playground paths - * so that multiple worker threads can share the same files. - * - /internal - * - /tmp - * - /wordpress - * - * Sharing the same files leads to faster boot times and uses less memory - * because we don't have to create or maintain multiple copies of the same files. - */ - const tempDirNameDelimiter = '-playground-cli-site-'; - const nativeDir = - await createPlaygroundCliTempDir(tempDirNameDelimiter); - logger.debug(`Native temp dir for VFS root: ${nativeDir.path}`); - - const IDEConfigName = 'WP Playground CLI - Listen for Xdebug'; - - // Always clean up any existing Playground files symlink in the project root. - const symlinkName = '.playground-xdebug-root'; - const symlinkPath = path.join(process.cwd(), symlinkName); - - await removeTempDirSymlink(symlinkPath); - - // Then, if xdebug, and experimental IDE are enabled, - // recreate the symlink pointing to the temporary - // directory and add the new IDE config. - if (args.xdebug && args.experimentalUnsafeIdeIntegration) { - await createTempDirSymlink( - nativeDir.path, - symlinkPath, - process.platform - ); + try { + // NOTE: Both the 'clear' and 'add' operations can throw errors. + await clearXdebugIDEConfig(IDEConfigName, process.cwd()); + + const xdebugOptions = + typeof args.xdebug === 'object' ? args.xdebug : undefined; + const modifiedConfig = await addXdebugIDEConfig({ + name: IDEConfigName, + host: host, + port: args['port']!, + ides: args.experimentalUnsafeIdeIntegration!, + cwd: process.cwd(), + mounts: [ + symlinkMount, + ...(args['mount-before-install'] || []), + ...(args.mount || []), + ], + ideKey: xdebugOptions?.ideKey, + }); - const symlinkMount: Mount = { - hostPath: path.join('.', path.sep, symlinkName), - vfsPath: '/', - }; - - try { - // NOTE: Both the 'clear' and 'add' operations can throw errors. - await clearXdebugIDEConfig(IDEConfigName, process.cwd()); - - const xdebugOptions = - typeof args.xdebug === 'object' - ? args.xdebug - : undefined; - const modifiedConfig = await addXdebugIDEConfig({ - name: IDEConfigName, - host: host, - port: port, - ides: args.experimentalUnsafeIdeIntegration!, - cwd: process.cwd(), - mounts: [ - symlinkMount, - ...(args['mount-before-install'] || []), - ...(args.mount || []), - ], - ideKey: xdebugOptions?.ideKey, - }); - - // Display IDE-specific instructions - const ides = args.experimentalUnsafeIdeIntegration; - const hasVSCode = ides.includes('vscode'); - const hasPhpStorm = ides.includes('phpstorm'); - const configFiles = Object.values(modifiedConfig); + // Display IDE-specific instructions + const ides = args.experimentalUnsafeIdeIntegration; + const hasVSCode = ides.includes('vscode'); + const hasPhpStorm = ides.includes('phpstorm'); + const configFiles = Object.values(modifiedConfig); - console.log(''); + console.log(''); - if (configFiles.length > 0) { - console.log(bold(`Xdebug configured successfully`)); - console.log( - highlight(`Updated IDE config: `) + - configFiles.join(' ') - ); - console.log( - highlight('Playground source root: ') + - `.playground-xdebug-root` + - italic( - dim( - ` – you can set breakpoints and preview Playground's VFS structure in there.` - ) - ) - ); - } else { - console.log(bold(`Xdebug configuration failed.`)); - console.log( - 'No IDE-specific project settings directory was found in the current working directory.' - ); - } - - console.log(''); - - if (hasVSCode && modifiedConfig['vscode']) { - console.log(bold('VS Code / Cursor instructions:')); - console.log( - ' 1. Ensure you have installed an IDE extension for PHP Debugging' - ); - console.log( - ` (The ${bold('PHP Debug')} extension by ${bold( - 'Xdebug' - )} has been a solid option)` - ); - console.log( - ' 2. Open the Run and Debug panel on the left sidebar' - ); - console.log( - ` 3. Select "${italic( - IDEConfigName - )}" from the dropdown` - ); - console.log(' 3. Click "start debugging"'); - console.log( - ' 5. Set a breakpoint. For example, in .playground-xdebug-root/wordpress/index.php' - ); - console.log( - ' 6. Visit Playground in your browser to hit the breakpoint' - ); - if (hasPhpStorm) { - console.log(''); - } - } + if (configFiles.length > 0) { + console.log(bold(`Xdebug configured successfully`)); + console.log( + highlight(`Updated IDE config: `) + configFiles.join(' ') + ); + console.log( + highlight('Playground source root: ') + + `.playground-xdebug-root` + + italic( + dim( + ` – you can set breakpoints and preview Playground's VFS structure in there.` + ) + ) + ); + } else { + console.log(bold(`Xdebug configuration failed.`)); + console.log( + 'No IDE-specific project settings directory was found in the current working directory.' + ); + } - if (hasPhpStorm && modifiedConfig['phpstorm']) { - console.log(bold('PhpStorm instructions:')); - console.log( - ` 1. Choose "${italic( - IDEConfigName - )}" debug configuration in the toolbar` - ); - console.log(' 2. Click the debug button (bug icon)`'); - console.log( - ' 3. Set a breakpoint. For example, in .playground-xdebug-root/wordpress/index.php' - ); - console.log( - ' 4. Visit Playground in your browser to hit the breakpoint' - ); - } + console.log(''); + if (hasVSCode && modifiedConfig['vscode']) { + console.log(bold('VS Code / Cursor instructions:')); + console.log( + ' 1. Ensure you have installed an IDE extension for PHP Debugging' + ); + console.log( + ` (The ${bold('PHP Debug')} extension by ${bold( + 'Xdebug' + )} has been a solid option)` + ); + console.log( + ' 2. Open the Run and Debug panel on the left sidebar' + ); + console.log( + ` 3. Select "${italic(IDEConfigName)}" from the dropdown` + ); + console.log(' 3. Click "start debugging"'); + console.log( + ' 5. Set a breakpoint. For example, in .playground-xdebug-root/wordpress/index.php' + ); + console.log( + ' 6. Visit Playground in your browser to hit the breakpoint' + ); + if (hasPhpStorm) { console.log(''); - } catch (error) { - throw new Error('Could not configure Xdebug', { - cause: error, - }); } } - // We do not know the system temp dir, - // but we can try to infer from the location of the current temp dir. - const tempDirRoot = path.dirname(nativeDir.path); + if (hasPhpStorm && modifiedConfig['phpstorm']) { + console.log(bold('PhpStorm instructions:')); + console.log( + ` 1. Choose "${italic( + IDEConfigName + )}" debug configuration in the toolbar` + ); + console.log(' 2. Click the debug button (bug icon)`'); + console.log( + ' 3. Set a breakpoint. For example, in .playground-xdebug-root/wordpress/index.php' + ); + console.log( + ' 4. Visit Playground in your browser to hit the breakpoint' + ); + } + + console.log(''); + } catch (error) { + throw new Error('Could not configure Xdebug', { + cause: error, + }); + } + } + + // We do not know the system temp dir, + // but we can try to infer from the location of the current temp dir. + const tempDirRoot = path.dirname(nativeDir.path); + + const twoDaysInMillis = 2 * 24 * 60 * 60 * 1000; + const tempDirStaleAgeInMillis = twoDaysInMillis; + + // NOTE: This is an async operation, but we do not care to block on it. + // Let's let the cleanup happen as the main thread has time. + cleanupStalePlaygroundTempDirs( + tempDirNameDelimiter, + tempDirStaleAgeInMillis, + tempDirRoot + ); + + // NOTE: We do not add mount declarations for /internal here + // because it will be mounted as part of php-wasm init. + const nativeInternalDirPath = path.join(nativeDir.path, 'internal'); + mkdirSync(nativeInternalDirPath); + + const userProvidableNativeSubdirs = [ + 'wordpress', + // Note: These dirs are from Emscripten's "default dirs" list: + // https://github.com/emscripten-core/emscripten/blob/f431ec220e472e1f8d3db6b52fe23fb377facf30/src/lib/libfs.js#L1400-L1402 + // + // Any Playground process with multiple workers may assume + // these are part of a shared filesystem, so let's recognize + // them explicitly here. + 'tmp', + 'home', + ]; + + for (const subdirName of userProvidableNativeSubdirs) { + const isMountingSubdirName = (mount: Mount) => + mount.vfsPath === `/${subdirName}`; + const thisSubdirHasAMount = + args['mount-before-install']?.some(isMountingSubdirName) || + args['mount']?.some(isMountingSubdirName); + if (!thisSubdirHasAMount) { + // The user hasn't requested mounting a different native dir for this path, + // so let's create a mount from within our native temp dir. + const nativeSubdirPath = path.join(nativeDir.path, subdirName); + mkdirSync(nativeSubdirPath); + + if (args['mount-before-install'] === undefined) { + args['mount-before-install'] = []; + } - const twoDaysInMillis = 2 * 24 * 60 * 60 * 1000; - const tempDirStaleAgeInMillis = twoDaysInMillis; + // Make the real mount first so any further subdirs are mounted into it. + args['mount-before-install'].unshift({ + vfsPath: `/${subdirName}`, + hostPath: nativeSubdirPath, + }); + } + } - // NOTE: This is an async operation, but we do not care to block on it. - // Let's let the cleanup happen as the main thread has time. - cleanupStalePlaygroundTempDirs( - tempDirNameDelimiter, - tempDirStaleAgeInMillis, - tempDirRoot + if (args['mount-before-install']) { + for (const mount of args['mount-before-install']) { + logger.debug( + `Mount before WP install: ${mount.vfsPath} -> ${mount.hostPath}` ); + } + } + if (args['mount']) { + for (const mount of args['mount']) { + logger.debug( + `Mount after WP install: ${mount.vfsPath} -> ${mount.hostPath}` + ); + } + } - // NOTE: We do not add mount declarations for /internal here - // because it will be mounted as part of php-wasm init. - const nativeInternalDirPath = path.join(nativeDir.path, 'internal'); - mkdirSync(nativeInternalDirPath); - - const userProvidableNativeSubdirs = [ - 'wordpress', - // Note: These dirs are from Emscripten's "default dirs" list: - // https://github.com/emscripten-core/emscripten/blob/f431ec220e472e1f8d3db6b52fe23fb377facf30/src/lib/libfs.js#L1400-L1402 - // - // Any Playground process with multiple workers may assume - // these are part of a shared filesystem, so let's recognize - // them explicitly here. - 'tmp', - 'home', - ]; - - for (const subdirName of userProvidableNativeSubdirs) { - const isMountingSubdirName = (mount: Mount) => - mount.vfsPath === `/${subdirName}`; - const thisSubdirHasAMount = - args['mount-before-install']?.some(isMountingSubdirName) || - args['mount']?.some(isMountingSubdirName); - if (!thisSubdirHasAMount) { - // The user hasn't requested mounting a different native dir for this path, - // so let's create a mount from within our native temp dir. - const nativeSubdirPath = path.join( - nativeDir.path, - subdirName - ); - mkdirSync(nativeSubdirPath); + let handler: BlueprintsV1Handler | BlueprintsV2Handler; + if (args['experimental-blueprints-v2-runner']) { + handler = new BlueprintsV2Handler(args, { + siteUrl, + processIdSpaceLength, + }); + } else { + handler = new BlueprintsV1Handler(args, { + siteUrl, + processIdSpaceLength, + }); - if (args['mount-before-install'] === undefined) { - args['mount-before-install'] = []; - } + if (typeof args.blueprint === 'string') { + args.blueprint = await resolveBlueprint({ + sourceString: args.blueprint, + blueprintMayReadAdjacentFiles: + args['blueprint-may-read-adjacent-files'] === true, + }); + } + } - // Make the real mount first so any further subdirs are mounted into it. - args['mount-before-install'].unshift({ - vfsPath: `/${subdirName}`, - hostPath: nativeSubdirPath, - }); - } - } + // Remember whether we are already disposing so we can avoid: + // - we can avoid multiple, conflicting dispose attempts + // - logging that a worker exited while the CLI itself is exiting + let disposing = false; + const disposeCLI = async function disposeCLI() { + if (disposing) { + return; + } - if (args['mount-before-install']) { - for (const mount of args['mount-before-install']) { - logger.debug( - `Mount before WP install: ${mount.vfsPath} -> ${mount.hostPath}` - ); + disposing = true; + await Promise.all( + [...playgroundsToCleanUp].map( + async ([workerProcess, playground]) => { + await playground.dispose(); + await playground[releaseRemoteApiProxy](); + await killWorkerProcess(workerProcess); } - } - if (args['mount']) { - for (const mount of args['mount']) { - logger.debug( - `Mount after WP install: ${mount.vfsPath} -> ${mount.hostPath}` - ); - } - } + ) + ); + await nativeDir.cleanup(); + }; - let handler: BlueprintsV1Handler | BlueprintsV2Handler; - if (args['experimental-blueprints-v2-runner']) { - handler = new BlueprintsV2Handler(args, { - siteUrl, - processIdSpaceLength, - }); - } else { - handler = new BlueprintsV1Handler(args, { - siteUrl, - processIdSpaceLength, - }); + // Kick off worker threads now to save time later. + // There is no need to wait for other async processes to complete. + const promisedWorkerProcesses = spawnWorkerProcesses( + totalWorkersToSpawn, + handler.getWorkerType(), + ({ exitCode, workerIndex }) => { + // We are already disposing, so worker exit is expected + // and does not need to be logged. + if (disposing) { + return; + } - if (typeof args.blueprint === 'string') { - args.blueprint = await resolveBlueprint({ - sourceString: args.blueprint, - blueprintMayReadAdjacentFiles: - args['blueprint-may-read-adjacent-files'] === true, - }); - } + if (exitCode === 0) { + return; } - // Remember whether we are already disposing so we can avoid: - // - we can avoid multiple, conflicting dispose attempts - // - logging that a worker exited while the CLI itself is exiting - let disposing = false; - const disposeCLI = async function disposeCLI() { - if (disposing) { - return; - } + logger.error( + `Worker ${workerIndex} exited with code ${exitCode}\n` + ); + // @TODO: Should we respawn the worker if it exited with an error and the CLI is not shutting down? + } + ); - disposing = true; - await Promise.all( - [...playgroundsToCleanUp].map( - async ([worker, playground]) => { - await playground.dispose(); - await worker.terminate(); - } - ) + logger.log(`Starting workers...`); + + try { + const workerProcesses = await promisedWorkerProcesses; + + // NOTE: Using a free-standing block to isolate initial boot vars + // while keeping the logic inline. + { + // TODO: Restore "WordPress is not ready yet" server response before WP setup? + + // Create an initial server to: + // 1. Prove that we can listen on the specified port before spawning workers. + // 2. Respond to requests until WordPress is ready. + // const initialServer = await startServer({ + // port: args['port']!, + // handleRequest: async () => { + // return PHPResponse.forHttpCode( + // 502, + // 'WordPress is not ready yet' + // ); + // } + // }); + // Boot the primary worker using the handler + const initialWorkerProcess = workerProcesses.shift()!; + const initialPlayground = + await handler.bootAndSetUpInitialPlayground( + initialWorkerProcess, + nativeInternalDirPath ); - if (server) { - await new Promise((resolve) => server.close(resolve)); - } - await nativeDir.cleanup(); - }; + playgroundsToCleanUp.set(initialWorkerProcess, initialPlayground); - // Kick off worker threads now to save time later. - // There is no need to wait for other async processes to complete. - const promisedWorkers = spawnWorkerThreads( - totalWorkersToSpawn, - handler.getWorkerType(), - ({ exitCode, workerIndex }) => { - // We are already disposing, so worker exit is expected - // and does not need to be logged. - if (disposing) { - return; - } + await initialPlayground.isReady(); + logger.log(`Booted!`); - if (exitCode !== 0) { - return; - } + if (!args['experimental-blueprints-v2-runner']) { + const compiledBlueprint = await ( + handler as BlueprintsV1Handler + ).compileInputBlueprint( + args['additional-blueprint-steps'] || [] + ); - logger.error( - `Worker ${workerIndex} exited with code ${exitCode}\n` + if (compiledBlueprint) { + logger.log(`Running the Blueprint...`); + await runBlueprintV1Steps( + compiledBlueprint, + initialPlayground as UniversalPHP ); - // @TODO: Should we respawn the worker if it exited with an error and the CLI is not shutting down? + logger.log(`Finished running the blueprint`); } - ); - - logger.log(`Starting up workers`); - - try { - const workers = await promisedWorkers; - - const fileLockManagerPort = - await exposeFileLockManager(fileLockManager); + } - // NOTE: Using a free-standing block to isolate initial boot vars - // while keeping the logic inline. - { - // Boot the primary worker using the handler - const initialWorker = workers.shift()!; - const initialPlayground = - await handler.bootAndSetUpInitialPlayground( - initialWorker.phpPort, - fileLockManagerPort, - nativeInternalDirPath - ); - playgroundsToCleanUp.set( - initialWorker.worker, - initialPlayground - ); + if (args.command === 'build-snapshot') { + await zipSite(initialPlayground, args.outfile as string); + logger.log(`WordPress exported to ${args.outfile}`); + await disposeCLI(); + return; + } else if (args.command === 'run-blueprint') { + logger.log(`Blueprint executed`); + await disposeCLI(); + return; + } - await initialPlayground.isReady(); - wordPressReady = true; - logger.log(`Booted!`); + await initialPlayground.dispose(); + await initialPlayground[releaseRemoteApiProxy](); + await killWorkerProcess(initialWorkerProcess); + playgroundsToCleanUp.delete(initialWorkerProcess); + } - loadBalancer = new LoadBalancer(initialPlayground); + logger.log(`Preparing workers...`); - if (!args['experimental-blueprints-v2-runner']) { - const compiledBlueprint = await ( - handler as BlueprintsV1Handler - ).compileInputBlueprint( - args['additional-blueprint-steps'] || [] - ); + // Boot additional workers using the handler + const initialWorkerProcessIdSpace = processIdSpaceLength; + // Just take the first Playground instance to be returned to the caller. + [playground] = (await Promise.all( + workerProcesses.map(async (workerProcess, index) => { + const firstProcessId = + initialWorkerProcessIdSpace + index * processIdSpaceLength; - if (compiledBlueprint) { - logger.log(`Running the Blueprint...`); - await runBlueprintV1Steps( - compiledBlueprint, - initialPlayground as UniversalPHP - ); - logger.log(`Finished running the blueprint`); - } - } + const additionalPlayground = await handler.bootPlayground({ + workerProcess, + firstProcessId, + nativeInternalDirPath, + }); - if (args.command === 'build-snapshot') { - await zipSite(playground, args.outfile as string); - logger.log(`WordPress exported to ${args.outfile}`); - await disposeCLI(); - return; - } else if (args.command === 'run-blueprint') { - logger.log(`Blueprint executed`); - await disposeCLI(); - return; - } + playgroundsToCleanUp.set(workerProcess, additionalPlayground); - // We discard the initial Playground worker because it can - // be configured differently than post-boot workers. - // For example, we do not enable Xdebug by default for the initial worker. - await loadBalancer.removeWorker(initialPlayground); - await initialPlayground.dispose(); - await initialWorker.worker.terminate(); - playgroundsToCleanUp.delete(initialWorker.worker); - } - - logger.log(`Preparing workers...`); - - // Boot additional workers using the handler - const initialWorkerProcessIdSpace = processIdSpaceLength; - // Just take the first Playground instance to be returned to the caller. - [playground] = await Promise.all( - workers.map(async (worker, index) => { - const firstProcessId = - initialWorkerProcessIdSpace + - index * processIdSpaceLength; - - const fileLockManagerPort = - await exposeFileLockManager(fileLockManager); - - const additionalPlayground = - await handler.bootPlayground({ - worker, - fileLockManagerPort, - firstProcessId, - nativeInternalDirPath, - }); - - playgroundsToCleanUp.set( - worker.worker, - additionalPlayground - ); - loadBalancer.addWorker(additionalPlayground); + return additionalPlayground; + }) + )) as [RemoteAPI]; - return additionalPlayground; - }) - ); + logger.log( + `WordPress is running on ${serverUrl} with ${targetWorkerCount} worker(s)` + ); - logger.log( - `WordPress is running on ${serverUrl} with ${targetWorkerCount} worker(s)` - ); + if (args.xdebug && args.experimentalDevtools) { + const bridge = await startBridge({ + phpInstance: playground, + phpRoot: '/wordpress', + }); - if (args.xdebug && args.experimentalDevtools) { - const bridge = await startBridge({ - phpInstance: playground, - phpRoot: '/wordpress', - }); + bridge.start(); + } - bridge.start(); - } + return { + playground, + serverUrl, + [Symbol.asyncDispose]: disposeCLI, + [internalsKeyForTesting]: { + workerThreadCount: targetWorkerCount, + getWorkerNumberFromProcessId: (processId: number) => { + return Math.floor(processId / processIdSpaceLength); + }, + }, + }; + } catch (error) { + if (!args.debug) { + throw error; + } + let phpLogs = ''; + if (playground && (await playground.fileExists(errorLogPath))) { + phpLogs = await playground.readFileAsText(errorLogPath); + } + await disposeCLI(); + throw new Error(phpLogs, { cause: error }); + } - return { - playground, - server, - serverUrl, - [Symbol.asyncDispose]: disposeCLI, - [internalsKeyForTesting]: { - workerThreadCount: targetWorkerCount, - getWorkerNumberFromProcessId: (processId: number) => { - return Math.floor(processId / processIdSpaceLength); - }, - }, - }; - } catch (error) { - if (!args.debug) { - throw error; - } - let phpLogs = ''; - if (await playground?.fileExists(errorLogPath)) { - phpLogs = await playground.readFileAsText(errorLogPath); - } - await disposeCLI(); - throw new Error(phpLogs, { cause: error }); - } - }, - async handleRequest(request: PHPRequest) { - if (!wordPressReady) { - return PHPResponse.forHttpCode( - 502, - 'WordPress is not ready yet' - ); - } - // Clear the playground_auto_login_already_happened cookie on the first request. - // Otherwise the first Playground CLI server started on the machine will set it, - // all the subsequent runs will get the stale cookie, and the auto-login will - // assume they don't have to auto-login again. - if (isFirstRequest) { - isFirstRequest = false; - const headers: Record = { - 'Content-Type': ['text/plain'], - 'Content-Length': ['0'], - Location: [request.url], - }; - if ( - request.headers?.['cookie']?.includes( - 'playground_auto_login_already_happened' - ) - ) { - headers['Set-Cookie'] = [ - 'playground_auto_login_already_happened=1; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/', - ]; - } - return new PHPResponse(302, headers, new Uint8Array()); - } - return await loadBalancer.handleRequest(request); - }, - }); + // TODO: Restore this for the first Playground CLI request + // // Clear the playground_auto_login_already_happened cookie on the first request. + // // Otherwise the first Playground CLI server started on the machine will set it, + // // all the subsequent runs will get the stale cookie, and the auto-login will + // // assume they don't have to auto-login again. + // if (isFirstRequest) { + // isFirstRequest = false; + // const headers: Record = { + // 'Content-Type': ['text/plain'], + // 'Content-Length': ['0'], + // Location: [request.url], + // }; + // if ( + // request.headers?.['cookie']?.includes( + // 'playground_auto_login_already_happened' + // ) + // ) { + // headers['Set-Cookie'] = [ + // 'playground_auto_login_already_happened=1; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/', + // ]; + // } + // return new PHPResponse(302, headers, new Uint8Array()); + // } } -export type SpawnedWorker = { - worker: Worker; - phpPort: NodeMessagePort; -}; +export type SpawnedWorker = ClusterProcess | ChildProcess; -async function spawnWorkerThreads( +async function spawnWorkerProcesses( count: number, workerType: WorkerType, onWorkerExit: (options: { exitCode: number; workerIndex: number }) => void @@ -1157,7 +1090,7 @@ async function spawnWorkerThreads( workerIndex: i, }); }; - const worker = spawnWorkerThread(workerType, { onExit }); + const worker = spawnWorkerProcess(workerType, { onExit }); promises.push(worker); } return Promise.all(promises); @@ -1174,7 +1107,7 @@ async function spawnWorkerThreads( * @param workerType * @returns */ -export function spawnWorkerThread( +export function spawnWorkerProcess( workerType: 'v1' | 'v2', { onExit }: { onExit?: (code: number) => void } = {} ) { @@ -1191,23 +1124,41 @@ export function spawnWorkerThread( // @ts-expect-error globalThis['__WORKER_V2_URL__'] = './blueprints-v2/worker-thread-v2.ts'; } - let worker: Worker; + let workerProcess: SpawnedWorker; + + const fork = cluster.isPrimary + ? (workerUrl: URL) => { + cluster.setupPrimary({ + exec: fileURLToPath(workerUrl), + serialization: 'advanced', + }); + return cluster.fork(); + } + : // If this is isn't the primary cluster process, + // we need to spawn a child process instead. + // In this case, we expect to be spawning workers for proc_open(). + (workerUrl: URL) => { + return childProcess.fork(workerUrl, { + stdio: 'inherit', + serialization: 'advanced', + }); + }; if (workerType === 'v1') { - worker = new Worker(new URL(__WORKER_V1_URL__, import.meta.url)); + workerProcess = fork(new URL(__WORKER_V1_URL__, import.meta.url)); } else { - worker = new Worker(new URL(__WORKER_V2_URL__, import.meta.url)); + workerProcess = fork(new URL(__WORKER_V2_URL__, import.meta.url)); } return new Promise((resolve, reject) => { - worker.once('message', function (message: any) { + workerProcess.once('message', function (message: any) { // Let the worker confirm it has initialized. // We could use the 'online' event to detect start of JS execution, // but that would miss initialization errors. if (message.command === 'worker-script-initialized') { - resolve({ worker, phpPort: message.phpPort }); + resolve(workerProcess); } }); - worker.once('error', function (e: Error) { + workerProcess.once('error', function (e: Error) { console.error(e); const error = new Error( `Worker failed to load worker. ${ @@ -1217,39 +1168,21 @@ export function spawnWorkerThread( reject(error); }); let spawned = false; - worker.once('spawn', () => { + workerProcess.once('spawn', () => { spawned = true; }); - worker.once('exit', (code) => { + workerProcess.once('exit', (code) => { if (!spawned) { reject(new Error(`Worker exited before spawning: ${code}`)); } - onExit?.(code); + // TODO: Should we use a non-zero error code if the process exited due to a signal? + onExit?.(code ?? 0); }); }); } -/** - * Expose the file lock manager API on a MessagePort and return it. - * - * @see comlink-sync.ts - * @see phpwasm-emscripten-library-file-locking-for-node.js - */ -async function exposeFileLockManager(fileLockManager: FileLockManagerForNode) { - const { port1, port2 } = new NodeMessageChannel(); - /** - * Always expose a synchronous API for the file lock manager - * so our injected system call overrides don't have to switch - * between synchronous and asynchronous APIs. - * - * @todo: Fill in the file containing the injected file locking system calls. - * @see comlink-sync.ts - * @see phpwasm-emscripten-library-file-locking-for-node.js - */ - await exposeSyncAPI(fileLockManager, port1); - return port2; -} - +// TODO: Move this to the initial worker process so we can +// avoid passing non-JSON-serializable objects to and from the worker. async function zipSite( playground: RemoteAPI, outfile: string @@ -1277,3 +1210,10 @@ async function zipSite( const zip = await playground.readFileAsBuffer('/tmp/build.zip'); fs.writeFileSync(outfile, zip); } + +export function killWorkerProcess(workerProcess: SpawnedWorker): Promise { + return new Promise((resolve) => { + workerProcess.on('exit', resolve); + workerProcess.kill(); + }); +} diff --git a/packages/playground/cli/src/start-server.ts b/packages/playground/cli/src/start-server.ts index 396e40b625..2f14fe5b6c 100644 --- a/packages/playground/cli/src/start-server.ts +++ b/packages/playground/cli/src/start-server.ts @@ -1,62 +1,53 @@ import { type PHPRequest, PHPResponse } from '@php-wasm/universal'; -import type { Request } from 'express'; -import express from 'express'; import type { IncomingMessage, Server, ServerResponse } from 'http'; -import type { AddressInfo } from 'net'; -import type { RunCLIServer } from './run-cli'; import { logger } from '@php-wasm/logger'; +import http from 'http'; export interface ServerOptions { port: number; - onBind: (server: Server, port: number) => Promise; handleRequest: (request: PHPRequest) => Promise; } -export async function startServer( - options: ServerOptions -): Promise { - const app = express(); +export async function startServer(options: ServerOptions) { + const server = http.createServer(); + await new Promise>( + (resolve, reject) => { + const server = http.createServer(async (req, res) => { + let phpResponse: PHPResponse; + try { + phpResponse = await options.handleRequest({ + // TODO: Is there a time where req.url will not be set? + url: req.url!, + headers: parseHeaders(req), + method: req.method as any, + body: await bufferRequestBody(req), + }); + } catch (error) { + logger.error(error); + phpResponse = PHPResponse.forHttpCode(500); + } - const server = await new Promise< - Server - >((resolve, reject) => { - const server = app.listen(options.port, () => { - const address = server.address(); - if (address === null || typeof address === 'string') { - reject(new Error('Server address is not available')); - } else { - resolve(server); - } - }); - }); - - app.use('/', async (req, res) => { - let phpResponse: PHPResponse; - try { - phpResponse = await options.handleRequest({ - url: req.url, - headers: parseHeaders(req), - method: req.method as any, - body: await bufferRequestBody(req), + res.statusCode = phpResponse.httpStatusCode; + for (const key in phpResponse.headers) { + res.setHeader(key, phpResponse.headers[key]); + } + res.end(phpResponse.bytes); + }); + server.listen(options.port, () => { + const address = server.address(); + if (address === null || typeof address === 'string') { + reject(new Error('Server address is not available')); + } else { + resolve(server); + } }); - } catch (error) { - logger.error(error); - phpResponse = PHPResponse.forHttpCode(500); - } - - res.statusCode = phpResponse.httpStatusCode; - for (const key in phpResponse.headers) { - res.setHeader(key, phpResponse.headers[key]); } - res.end(phpResponse.bytes); - }); + ); - const address = server.address(); - const port = (address! as AddressInfo).port; - return await options.onBind(server, port); + return server; } -const bufferRequestBody = async (req: Request): Promise => +const bufferRequestBody = async (req: IncomingMessage): Promise => await new Promise((resolve) => { const body: Uint8Array[] = []; req.on('data', (chunk) => { @@ -67,7 +58,7 @@ const bufferRequestBody = async (req: Request): Promise => }); }); -const parseHeaders = (req: Request): Record => { +const parseHeaders = (req: IncomingMessage): Record => { const requestHeaders: Record = {}; if (req.rawHeaders && req.rawHeaders.length) { for (let i = 0; i < req.rawHeaders.length; i += 2) { diff --git a/packages/playground/cli/tests/run-cli.spec.ts b/packages/playground/cli/tests/run-cli.spec.ts index 6e32199e98..b56d7df447 100644 --- a/packages/playground/cli/tests/run-cli.spec.ts +++ b/packages/playground/cli/tests/run-cli.spec.ts @@ -25,16 +25,20 @@ import { type Log, logger } from '@php-wasm/logger'; const blueprintVersions = [ { version: 1, - suiteCliArgs: {}, - expectedHomePageTitle: 'My WordPress Website', - }, - { - version: 2, suiteCliArgs: { - 'experimental-blueprints-v2-runner': true, + // TODO: Decide how to default the number of worker processes. + experimentalMultiWorker: 10, }, - expectedHomePageTitle: 'WordPress Site', + expectedHomePageTitle: 'My WordPress Website', }, + // TODO: Re-enable this when Blueprints v2 works with multi-process Playground CLI. + // { + // version: 2, + // suiteCliArgs: { + // 'experimental-blueprints-v2-runner': true, + // }, + // expectedHomePageTitle: 'WordPress Site', + // }, ]; describe.each(blueprintVersions)( @@ -267,9 +271,6 @@ describe.each(blueprintVersions)( }, ], }); - expect( - cliServer[internalsKeyForTesting].workerThreadCount - ).toBe(1); // Make multiple simultaneous requests to force the use of a secondary PHP instance. // TODO: Find way to confirm this. Maybe a custom response header that announces the worker. const sleepUrl = new URL( @@ -358,7 +359,7 @@ describe.each(blueprintVersions)( expect(setupText).toContain( `${expectedHomePageTitle}` ); - await cliServer.server.close(); + await cliServer[Symbol.asyncDispose](); cliServer = await runCLI({ ...suiteCliArgs, @@ -649,7 +650,7 @@ describe.each(blueprintVersions)( expect(output).toEqual( expect.arrayContaining([ 'Starting a PHP server...', - 'Starting up workers', + 'Starting workers...', expect.stringMatching( /^Resolved WordPress release URL: https:\/\/downloads\.w(ordpress)?\.org\/release\/wordpress-\d+\.\d+(?:\.\d+|-RC\d+|-beta\d+)?\.zip$/ ),