From 0a3588059d0d03ebd5df014287c4c4f6d6d2c5de Mon Sep 17 00:00:00 2001 From: Tom Wilson Date: Fri, 31 May 2024 14:48:27 +0000 Subject: [PATCH] feat(loader): weavedrive should be optional for wasm64 --- loader/src/formats/wasm64-emscripten.cjs | 5 ++++- package-lock.json | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/loader/src/formats/wasm64-emscripten.cjs b/loader/src/formats/wasm64-emscripten.cjs index 76092003b..24e491cdd 100644 --- a/loader/src/formats/wasm64-emscripten.cjs +++ b/loader/src/formats/wasm64-emscripten.cjs @@ -670,6 +670,9 @@ var Module = (() => { function __asyncjs__weavedrive_open(c_filename, mode) { return Asyncify.handleAsync(async () => { const filename = UTF8ToString(Number(c_filename)); + if (!Module.WeaveDrive) { + return Promise.resolve(null); + } const drive = Module.WeaveDrive(Module, FS); return await drive.open(filename); }); @@ -5446,4 +5449,4 @@ var Module = (() => { if (typeof exports === 'object' && typeof module === 'object') module.exports = Module; else if (typeof define === 'function' && define['amd']) - define([], () => Module); + define([], () => Module); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 82941ba71..7772031f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,9 @@ "markdown-toc-gen": "^1.0.1", "sort-package-json": "^2.10.0", "standard": "^17.1.0" + }, + "engines": { + "yarn": "please-use-npm" } }, "loader": {