Bug 171078

Summary: WebAssembly: Module.exports, Module.imports, Module.customSections are wrong
Product: WebKit Reporter: JF Bastien <jfbastien>
Component: JavaScriptCoreAssignee: JF Bastien <jfbastien>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, fpizlo, jfbastien, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 161709    
Attachments:
Description Flags
patch
saam: review+, saam: commit-queue-
patch none

Description JF Bastien 2017-04-20 15:00:25 PDT
They're static properties of Module, not instance properties of a module.
https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymoduleexports
Comment 1 JF Bastien 2017-04-21 23:51:51 PDT
Created attachment 307896 [details]
patch
Comment 2 Saam Barati 2017-04-21 23:57:17 PDT
Comment on attachment 307896 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=307896&action=review

> Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp:64
> + customSections webAssemblyModuleCustomSections DontEnum|Function 2
> + imports        webAssemblyModuleImports        DontEnum|Function 1
> + exports        webAssemblyModuleExports        DontEnum|Function 1

Please add tests asserting these are functions w/ the correct length.

> Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp:74
> +    JSWebAssemblyModule* module = jsDynamicCast<JSWebAssemblyModule*>(vm,  exec->argument(0));

nit: 1 too many spaces before exec.

> Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp:91
> +            Structure* arrayBufferStructure = InternalFunction::createSubclassStructure(exec, JSValue(), globalObject->arrayBufferStructure(ArrayBufferSharingMode::Default));

Why createSubclassStructure here? Pretty sure this ain't needed. I think you should just use arrayBufferStructure
Comment 3 JF Bastien 2017-04-22 00:11:16 PDT
Created attachment 307897 [details]
patch
Comment 4 WebKit Commit Bot 2017-04-22 00:52:06 PDT
Comment on attachment 307897 [details]
patch

Clearing flags on attachment: 307897

Committed r215664: <http://trac.webkit.org/changeset/215664>
Comment 5 WebKit Commit Bot 2017-04-22 00:52:07 PDT
All reviewed patches have been landed.  Closing bug.