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

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.

主站蜘蛛池模板: 华安县| 吴川市| 息烽县| 西华县| 犍为县| 郎溪县| 上杭县| 建阳市| 汶上县| 文登市| 九寨沟县| 长武县| 哈巴河县| 商都县| 馆陶县| 方正县| 新巴尔虎左旗| 蒙山县| 监利县| 友谊县| 马龙县| 阜新市| 如皋市| 衡阳县| 株洲县| 台前县| 长葛市| 红原县| 德钦县| 长海县| 介休市| 闽侯县| 黑龙江省| 都昌县| 信阳市| 辽宁省| 玉门市| 宾阳县| 防城港市| 沈阳市| 库车县|