X 归档 2021-03-10
I didn’t realize that all major browser engines have implemented (but not necessarily enabled) WebAssembly Reference Types.
This allows a Wasm module to hold an opaque reference to something from JS (like a DOM node!) and pass it around.
https://glitch.com/edit/#!/wasm-externref
This allows a Wasm module to hold an opaque reference to something from JS (like a DOM node!) and pass it around.
https://glitch.com/edit/#!/wasm-externref
我之前没意识到,所有主流浏览器引擎都已经实现了(但不一定启用了)WebAssembly 引用类型。
这让 Wasm 模块可以持有指向 JS 中某个东西(比如 DOM 节点!)的不透明引用,并把它传来传去。
这让 Wasm 模块可以持有指向 JS 中某个东西(比如 DOM 节点!)的不透明引用,并把它传来传去。




