diff --git a/src/library.js b/src/library.js index 132de3c2910b0..607e18e68de0d 100644 --- a/src/library.js +++ b/src/library.js @@ -2181,16 +2181,12 @@ addToLibrary({ return x.startsWith('dynCall_') ? x : '_' + x; }, - $asyncLoad: (url) => { - return new Promise((resolve, reject) => { - readAsync(url).then( - (arrayBuffer) => { + $asyncLoad: async (url) => { + var arrayBuffer = await readAsync(url); #if ASSERTIONS - assert(arrayBuffer, `Loading data file "${url}" failed (no arrayBuffer).`); + assert(arrayBuffer, `Loading data file "${url}" failed (no arrayBuffer).`); #endif - resolve(new Uint8Array(arrayBuffer)); - }, reject); - }); + return new Uint8Array(arrayBuffer); }, $alignMemory: (size, alignment) => { diff --git a/test/other/codesize/test_codesize_hello_dylink.gzsize b/test/other/codesize/test_codesize_hello_dylink.gzsize index 473dc4cba135f..00c2101f87831 100644 --- a/test/other/codesize/test_codesize_hello_dylink.gzsize +++ b/test/other/codesize/test_codesize_hello_dylink.gzsize @@ -1 +1 @@ -6276 +6274 diff --git a/test/other/codesize/test_codesize_hello_dylink.jssize b/test/other/codesize/test_codesize_hello_dylink.jssize index 153b68e34d9a0..47700e67fc42e 100644 --- a/test/other/codesize/test_codesize_hello_dylink.jssize +++ b/test/other/codesize/test_codesize_hello_dylink.jssize @@ -1 +1 @@ -13831 +13816