Skip to content

Commit ec11e85

Browse files
committed
chore! remove wasi js shim
This creates a mostly stubbed js fallback for functions, which leads to unexpected errors such as `e is not iterable`, and will additionally poke more holes in the sandbox than expected.
1 parent 7ecc912 commit ec11e85

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

crates/wasm-bridge-js/src/wasi/preview2/command.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@ use crate::component::Linker;
55
use crate::wasi::preview2::{clocks, WasiView};
66
use crate::{Result, StoreContextMut};
77

8-
use super::stdio::{STDERR_IDENT, STDIN_IDENT, STDOUT_IDENT};
98
use super::{environment, filesystem, preopens, stdio, streams, terminal};
109

11-
static WASI_IMPORTS_STR: &str =
12-
include_str!("../../../../../resources/transformed/preview2-shim/bundled.js");
13-
1410
pub fn add_to_linker<T: WasiView + 'static>(linker: &mut Linker<T>) -> Result<()> {
15-
// Default imports
16-
// linker.set_wasi_imports(get_imports());
17-
1811
// Overrides
1912
// linker.instance("wasi:io/streams")?.func_wrap(
2013
// "read",
@@ -84,25 +77,3 @@ pub fn add_to_linker<T: WasiView + 'static>(linker: &mut Linker<T>) -> Result<()
8477

8578
Ok(())
8679
}
87-
88-
/// Fills the wasi imports by the browser shim
89-
fn get_imports() -> Object {
90-
let imports = js_sys::eval(WASI_IMPORTS_STR).expect("eval bundled wasi imports");
91-
92-
assert!(
93-
imports.is_object(),
94-
"wasi imports must be an object, {imports:#?}"
95-
);
96-
97-
imports.into()
98-
}
99-
100-
#[cfg(test)]
101-
mod tests {
102-
use super::*;
103-
104-
#[wasm_bindgen_test::wasm_bindgen_test]
105-
fn should_get_imports() {
106-
let _ = get_imports();
107-
}
108-
}

0 commit comments

Comments
 (0)