Skip to content

Commit

Permalink
Make all detectors async (fixes #15)
Browse files Browse the repository at this point in the history
  • Loading branch information
surma committed Dec 3, 2019
1 parent 1408eaa commit 0b7fb4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rollup-plugins/index-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ export default function({ indexPath, pluginFolder }) {
const importName = `${pluginName}_internal`;
return `
import { default as ${importName} } from "./${pluginFolder}/${plugin}/index.js";
export const ${pluginName} = () => ${importName}(new Uint8Array(${moduleBytes}));
export const ${pluginName} = async () => ${importName}(new Uint8Array(${moduleBytes}));
`;
}
return `
export const ${pluginName} = () => WebAssembly.validate(new Uint8Array(${moduleBytes}));
export const ${pluginName} = async () => WebAssembly.validate(new Uint8Array(${moduleBytes}));
`;
})
);
Expand Down
2 changes: 1 addition & 1 deletion src/detectors/threads/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* limitations under the License.
*/

export default moduleBytes => {
export default async moduleBytes => {
if (!WebAssembly.validate(moduleBytes)) return false;
try {
// Test for transferability of SABs (needed for Firefox)
Expand Down

0 comments on commit 0b7fb4f

Please sign in to comment.