JSWebAssemblyInstance::finishCreation should do this: putDirect(vm, Identifier::fromString(&vm, "exports"), JSValue(m_moduleNamespaceObject.get()), None); Not its constructor. These tests should pass in test_basic_api.js: assert.isUndef(instance.exports.__proto__); assert.eq(Reflect.isExtensible(instance.exports), false); assert.eq(Symbol.iterator in instance.exports, true); assert.eq(Symbol.toStringTag in instance.exports, true); WebAssembly doesn't have circular linking and fancy things yet, so it's slightly simpler than ES6 modules. I'm sure this isn't super hard to fix, but the current code does what we need to get off the ground so I'd rather figure it out later.
I'll look into it.
Created attachment 295708 [details] Patch
Created attachment 295709 [details] Patch
Comment on attachment 295709 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295709&action=review > Source/JavaScriptCore/wasm/WasmFormat.cpp:37 > +#endif // COMPILER(GCC) && ASSERT_DISABLED This is B3 way for the following switch's warning.
Comment on attachment 295709 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295709&action=review Awesome, this was way simpler than I thought it was! :-) Looks good. >> Source/JavaScriptCore/wasm/WasmFormat.cpp:37 >> +#endif // COMPILER(GCC) && ASSERT_DISABLED > > This is B3 way for the following switch's warning. I'm auto-generating that code here: https://bugs.webkit.org/show_bug.cgi?id=164724
Comment on attachment 295709 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295709&action=review >>> Source/JavaScriptCore/wasm/WasmFormat.cpp:37 >>> +#endif // COMPILER(GCC) && ASSERT_DISABLED >> >> This is B3 way for the following switch's warning. > > I'm auto-generating that code here: https://bugs.webkit.org/show_bug.cgi?id=164724 Nice. Once the above patch is landed, we can simply drop this!
Comment on attachment 295709 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295709&action=review r=me > Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:36 > +#include "LLIntThunks.h" Was this file needed?
Comment on attachment 295709 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295709&action=review Thanks! >> Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:36 >> +#include "LLIntThunks.h" > > Was this file needed? It is necessary for `vmEntryToWasm`.
Committed r209171: <http://trac.webkit.org/changeset/209171>