mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-22 21:21:33 +00:00
implement wasi check
This commit is contained in:
@ -1,8 +1,15 @@
|
|||||||
use wasmer_runtime_core::{module::Module, vm::Ctx};
|
use wasmer_runtime_core::module::Module;
|
||||||
|
|
||||||
// Cargo culting this from our emscripten implementation for now, but it seems like a
|
/// Check if a provided module is compiled with WASI support
|
||||||
// good thing to check; TODO: verify this is useful
|
|
||||||
pub fn is_wasi_module(module: &Module) -> bool {
|
pub fn is_wasi_module(module: &Module) -> bool {
|
||||||
true
|
for (_, import_name) in &module.info().imported_functions {
|
||||||
// TODO:
|
let namespace = module
|
||||||
|
.info()
|
||||||
|
.namespace_table
|
||||||
|
.get(import_name.namespace_index);
|
||||||
|
if namespace == "wasi_unstable" {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user