2018-09-20 16:20:42 -07:00
|
|
|
# js-sys: WebAssembly in WebAssembly
|
|
|
|
|
2018-09-20 17:54:06 -07:00
|
|
|
[View full source code][code] or [view the compiled example online][online]
|
2018-09-20 16:20:42 -07:00
|
|
|
|
2018-09-20 17:54:06 -07:00
|
|
|
[online]: https://rustwasm.github.io/wasm-bindgen/exbuild/wasm-in-wasm/
|
2018-09-20 16:20:42 -07:00
|
|
|
[code]: https://github.com/rustwasm/wasm-bindgen/tree/master/examples/wasm-in-wasm
|
|
|
|
|
|
|
|
Using the `js-sys` crate we can get pretty meta and instantiate `WebAssembly`
|
|
|
|
modules from inside `WebAssembly` modules!
|
|
|
|
|
|
|
|
## `src/lib.rs`
|
|
|
|
|
|
|
|
```rust
|
|
|
|
{{#include ../../../examples/wasm-in-wasm/src/lib.rs}}
|
|
|
|
```
|