* Constructs a new LuaFactory instance. * @param [customWasmUri] - Custom URI for the Lua WebAssembly module. * @param [environmentVariables] - Environment variables for the Lua engine.
(customWasmUri?: string, environmentVariables?: EnvironmentVariables)
| 16 | * @param [environmentVariables] - Environment variables for the Lua engine. |
| 17 | */ |
| 18 | public constructor(customWasmUri?: string, environmentVariables?: EnvironmentVariables) { |
| 19 | if (customWasmUri === undefined) { |
| 20 | const isBrowser = |
| 21 | (typeof window === 'object' && typeof window.document !== 'undefined') || |
| 22 | (typeof self === 'object' && self?.constructor?.name === 'DedicatedWorkerGlobalScope') |
| 23 | |
| 24 | if (isBrowser) { |
| 25 | customWasmUri = `https://unpkg.com/wasmoon@${version}/dist/glue.wasm` |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | this.luaWasmPromise = LuaWasm.initialize(customWasmUri, environmentVariables) |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Mounts a file in the Lua environment asynchronously. |
nothing calls this directly
no test coverage detected