|
@@ -1259,7 +1259,7 @@ class WebGLInterface {
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
-function odinSetupDefaultImports(wasmMemoryInterface, consoleElement, memory, eventHookCallback) {
|
|
|
|
|
|
+function odinSetupDefaultImports(wasmMemoryInterface, consoleElement, memory) {
|
|
const MAX_INFO_CONSOLE_LINES = 512;
|
|
const MAX_INFO_CONSOLE_LINES = 512;
|
|
let infoConsoleLines = new Array();
|
|
let infoConsoleLines = new Array();
|
|
let currentLine = {};
|
|
let currentLine = {};
|
|
@@ -1275,11 +1275,7 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement, memory, ev
|
|
const exports = wasmMemoryInterface.exports;
|
|
const exports = wasmMemoryInterface.exports;
|
|
const odin_ctx = exports.default_context_ptr();
|
|
const odin_ctx = exports.default_context_ptr();
|
|
|
|
|
|
- const mute = eventHookCallback && !eventHookCallback(event_data.event, data, callback);
|
|
|
|
-
|
|
|
|
- if (!mute) {
|
|
|
|
- exports.odin_dom_do_event_callback(data, callback, odin_ctx);
|
|
|
|
- }
|
|
|
|
|
|
+ exports.odin_dom_do_event_callback(data, callback, odin_ctx);
|
|
|
|
|
|
event_temp.data = null;
|
|
event_temp.data = null;
|
|
};
|
|
};
|
|
@@ -1909,30 +1905,20 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement, memory, ev
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
-/**
|
|
|
|
- * A callback used to intersept events that are being dispatched to the application.
|
|
|
|
- * @callback EventHookCallback
|
|
|
|
- * @param {Object} [event] - The event that is about to be sent to the application.
|
|
|
|
- * @param {Object} [data] - The user data that was passed in when the event listener for {@param event} was registered.
|
|
|
|
- * @param {Object} [callback] - The callback that was passed in when the event listener for {@param event} was registered.
|
|
|
|
- * @return {bool} If false, the event will not be sent to the application.
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* @param {string} wasmPath - Path to the WASM module to run
|
|
* @param {string} wasmPath - Path to the WASM module to run
|
|
* @param {?HTMLPreElement} consoleElement - Optional console/pre element to append output to, in addition to the console
|
|
* @param {?HTMLPreElement} consoleElement - Optional console/pre element to append output to, in addition to the console
|
|
* @param {any} extraForeignImports - Imports, in addition to the default runtime to provide the module
|
|
* @param {any} extraForeignImports - Imports, in addition to the default runtime to provide the module
|
|
* @param {?WasmMemoryInterface} wasmMemoryInterface - Optional memory to use instead of the defaults
|
|
* @param {?WasmMemoryInterface} wasmMemoryInterface - Optional memory to use instead of the defaults
|
|
* @param {?int} intSize - Size (in bytes) of the integer type, should be 4 on `js_wasm32` and 8 on `js_wasm64p32`
|
|
* @param {?int} intSize - Size (in bytes) of the integer type, should be 4 on `js_wasm32` and 8 on `js_wasm64p32`
|
|
- * @param {?EventHookCallback} eventHookCallback - Callback that will be invoked when an event is dispatched to the application
|
|
|
|
*/
|
|
*/
|
|
-async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemoryInterface, intSize = 4, eventHookCallback = null) {
|
|
|
|
|
|
+async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemoryInterface, intSize = 4) {
|
|
if (!wasmMemoryInterface) {
|
|
if (!wasmMemoryInterface) {
|
|
wasmMemoryInterface = new WasmMemoryInterface();
|
|
wasmMemoryInterface = new WasmMemoryInterface();
|
|
}
|
|
}
|
|
wasmMemoryInterface.setIntSize(intSize);
|
|
wasmMemoryInterface.setIntSize(intSize);
|
|
|
|
|
|
- let imports = odinSetupDefaultImports(wasmMemoryInterface, consoleElement, wasmMemoryInterface.memory, eventHookCallback);
|
|
|
|
|
|
+ let imports = odinSetupDefaultImports(wasmMemoryInterface, consoleElement, wasmMemoryInterface.memory);
|
|
let exports = {};
|
|
let exports = {};
|
|
|
|
|
|
if (extraForeignImports !== undefined) {
|
|
if (extraForeignImports !== undefined) {
|