mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
feat: Wasm module support (#26668)
Support for Wasm modules. Note this implements the standard where the default export is the instance (not the module). The module will come later with source phase imports. ```ts import { add } from "./math.wasm"; console.log(add(1, 2)); ```
This commit is contained in:
parent
6b478cd0a3
commit
8be2bbf074
60 changed files with 401 additions and 46 deletions
|
@ -675,10 +675,12 @@ impl<'a> DenoCompileBinaryWriter<'a> {
|
|||
deno_graph::Module::Json(m) => {
|
||||
(Some(m.source.as_bytes().to_vec()), m.media_type)
|
||||
}
|
||||
deno_graph::Module::Wasm(m) => {
|
||||
(Some(m.source.to_vec()), MediaType::Wasm)
|
||||
}
|
||||
deno_graph::Module::Npm(_)
|
||||
| deno_graph::Module::Node(_)
|
||||
| deno_graph::Module::External(_) => (None, MediaType::Unknown),
|
||||
deno_graph::Module::Wasm(_) => todo!("@dsherret"),
|
||||
};
|
||||
if module.specifier().scheme() == "file" {
|
||||
let file_path = deno_path_util::url_to_file_path(module.specifier())?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue