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

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.

主站蜘蛛池模板: 台安县| 沁水县| 兴宁市| 明溪县| 铜鼓县| 鹿邑县| 名山县| 沾益县| 英超| 庄河市| 灵武市| 比如县| 沐川县| 灌云县| 左云县| 栖霞市| 博湖县| 辽中县| 麟游县| 桐柏县| 三门峡市| 左权县| 同江市| 新乡市| 益阳市| 阜南县| 辽宁省| 甘肃省| 临沧市| 平湖市| 乌拉特后旗| 镇平县| 祁门县| 涞水县| 洛南县| 通化县| 宝坻区| 都匀市| 肇源县| 湘潭市| 红原县|