Skip to content

Commit

Permalink
fix fsUtils is not defined at taobao platform
Browse files Browse the repository at this point in the history
  • Loading branch information
bofeng-song committed Jun 25, 2023
1 parent f9dd8bc commit b984b46
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pal/wasm/wasm-minigame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

// fsUtils is defined in engine-adapter
declare const fsUtils: any;

export function instantiateWasm (wasmUrl: string, importObject: WebAssembly.Imports): Promise<any> {
wasmUrl = `cocos-js/${wasmUrl}`;
Expand All @@ -32,7 +31,7 @@ export function instantiateWasm (wasmUrl: string, importObject: WebAssembly.Impo

export function fetchBuffer (binaryUrl: string): Promise<ArrayBuffer> {
return new Promise<ArrayBuffer>((resolve, reject) => {
fsUtils.readArrayBuffer(`cocos-js/${binaryUrl}`, (err, arrayBuffer) => {
globalThis.fsUtils.readArrayBuffer(`cocos-js/${binaryUrl}`, (err, arrayBuffer) => {
if (err) {
reject(err);
return;
Expand Down

0 comments on commit b984b46

Please sign in to comment.