Recognize "wasi_unstable_preview0" in addition to "wasi_unstable".

This commit is contained in:
Dan Gohman
2019-09-25 14:12:47 -07:00
parent 0667a2897d
commit 34766f64ea
2 changed files with 8 additions and 1 deletions

View File

@@ -316,6 +316,10 @@ fn rmain() -> Result<(), Error> {
"wasi_unstable".to_owned(), "wasi_unstable".to_owned(),
Instance::from_handle(store.clone(), wasi)?, Instance::from_handle(store.clone(), wasi)?,
); );
module_registry.insert(
"wasi_unstable_preview0".to_owned(),
Instance::from_handle(store.clone(), wasi)?,
);
// Load the preload wasm modules. // Load the preload wasm modules.
for filename in &args.flag_preload { for filename in &args.flag_preload {

View File

@@ -22,7 +22,10 @@ void handleFiles(void) {
__builtin_trap(); __builtin_trap();
EM_ASM(" \ EM_ASM(" \
const imports = { wasi_unstable: WASIPolyfill }; \ const imports = {\
wasi_unstable: WASIPolyfill, \
wasi_unstable_preview0: WASIPolyfill \
}; \
let file = document.getElementById('input').files[0]; \ let file = document.getElementById('input').files[0]; \
let file_with_mime_type = file.slice(0, file.size, 'application/wasm'); \ let file_with_mime_type = file.slice(0, file.size, 'application/wasm'); \
let response = new Response(file_with_mime_type); \ let response = new Response(file_with_mime_type); \