Bug 171078 - WebAssembly: Module.exports, Module.imports, Module.customSections are wrong
Summary: WebAssembly: Module.exports, Module.imports, Module.customSections are wrong
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: JF Bastien
URL:
Keywords:
Depends on:
Blocks: 161709
  Show dependency treegraph
 
Reported: 2017-04-20 15:00 PDT by JF Bastien
Modified: 2017-04-22 00:52 PDT (History)
7 users (show)

See Also:


Attachments
patch (23.13 KB, patch)
2017-04-21 23:51 PDT, JF Bastien
sbarati: review+
sbarati: commit-queue-
Details | Formatted Diff | Diff
patch (23.08 KB, patch)
2017-04-22 00:11 PDT, JF Bastien
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.