官术网_书友最值得收藏!

WebAssembly.Module

The WebAssembly.Module object is the intermediate step between the ArrayBuffer and the instantiated module. The compile() and instantiate() methods (and their streaming counterparts) return a Promise that resolves with a module (module in lowercase represents the compiled Module). A module can also be created synchronously by passing a typed array or ArrayBuffer directly into the constructor, but this is discouraged for large modules.

The Module object also has three static methods: exports(), imports(), and customSections(). All three take a module as a parameter, but customSections() takes a string representing the section name as its second parameter. Custom sections are described in the Binary Format section of the Core Specification and are intended to be used for debugging information or third-party extensions. In most cases, you won't need to define these. The exports() function is useful if you're using a Wasm module that you didn't create, although you'll only be able to see the name and kind (for example, function) of each export.

For simple use cases, you won't be dealing directly with the Module object or compiled module. Most of the interaction will take place with an Instance.

主站蜘蛛池模板: 虞城县| 海伦市| 团风县| 宣武区| 日土县| 温宿县| 洞头县| 清徐县| 天峨县| 三门峡市| 门头沟区| 汕尾市| 榆社县| 建平县| 萝北县| 油尖旺区| 华坪县| 望城县| 连江县| 综艺| 湾仔区| 淳安县| 读书| 唐海县| 涡阳县| 亳州市| 玉门市| 阜新| 韶关市| 霍州市| 浦县| 新乡县| 诏安县| 道真| 新安县| 寿阳县| 白玉县| 苗栗市| 肥城市| 平塘县| 吴旗县|