WebAssembly JS API: add Module.sections
https://bugs.webkit.org/show_bug.cgi?id=165159
<rdar://problem/
29760326>
Reviewed by Mark Lam.
JSTests:
As described here: https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymodulecustomsections
* wasm/Builder.js: allow custom sections to be duplicated
* wasm/js-api/Module.customSection.js: Added.
(assert.throws.WebAssembly.Module.prototype.customSections):
(assert.eq):
Source/JavaScriptCore:
As described in: https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymodulecustomsections
This was added for Emscripten, and is likely to be used soon.
* wasm/WasmFormat.h: custom sections are just name + bytes
* wasm/WasmModuleParser.cpp: parse them, instead of skipping over
* wasm/WasmModuleParser.h:
* wasm/js/WebAssemblyModulePrototype.cpp: construct the Array of
ArrayBuffer as described in the spec
(JSC::webAssemblyModuleProtoCustomSections):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210282
268f45cc-cd09-0410-ab3c-
d52691b4dbfc