[JSC] Improve wasm wpt test results by fixing miscellaneous issues
https://bugs.webkit.org/show_bug.cgi?id=199783

Reviewed by Mark Lam.

JSTests:

Fix our spec tests.

* wasm/js-api/Module-compile.js:
* wasm/js-api/test_basic_api.js:
(const.c.in.constructorProperties.switch):
* wasm/js-api/validate.js:
* wasm/js-api/web-assembly-instantiate.js:
* wasm/spec-tests/jsapi.js:
(testJSAPI.get test):
(testJSAPI.set test):

LayoutTests/imported/w3c:

Import web-platform-tests/wasm/jsapi. Some of tests are failing just because imported wpt tests are old.
They are fixed in the upstream. When upgrading wpt tests, we can mark them PASS.

* resources/import-expectations.json:
* web-platform-tests/wasm/jsapi/assertions.js: Added.
(assert_function_name):
(assert_function_length):
* web-platform-tests/wasm/jsapi/bad-imports.js: Added.
(test_bad_imports):
* web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html: Added.
* web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.js: Added.
(test_bad_imports):
* web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/constructor/w3c-import.log: Added.
* web-platform-tests/wasm/jsapi/global/constructor.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/global/constructor.any.html: Added.
* web-platform-tests/wasm/jsapi/global/constructor.any.js: Added.
(assert_Global):
(test):
(test.get assert_array_equals):
(string_appeared_here.test):
(string_appeared_here.toString):
(string_appeared_here.valueOf):
(string_appeared_here.name.format_value):
* web-platform-tests/wasm/jsapi/global/constructor.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/global/constructor.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/global/toString.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/global/toString.any.html: Added.
* web-platform-tests/wasm/jsapi/global/toString.any.js: Added.
(test):
* web-platform-tests/wasm/jsapi/global/toString.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/global/toString.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/global/value-set.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/global/value-set.any.html: Added.
* web-platform-tests/wasm/jsapi/global/value-set.any.js: Added.
(test):
(string_appeared_here.name.of.immutableOptions.test):
(string_appeared_here.name.of.mutableOptions.test):
* web-platform-tests/wasm/jsapi/global/value-set.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/global/value-set.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/global/valueOf.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/global/valueOf.any.html: Added.
* web-platform-tests/wasm/jsapi/global/valueOf.any.js: Added.
(test):
* web-platform-tests/wasm/jsapi/global/valueOf.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/global/w3c-import.log: Added.
* web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html: Added.
* web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.js: Added.
(test_bad_imports):
* web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/instance/constructor.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/instance/constructor.any.html: Added.
* web-platform-tests/wasm/jsapi/instance/constructor.any.js: Added.
(assert_exported_function):
* web-platform-tests/wasm/jsapi/instance/constructor.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/instance/exports.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/instance/exports.any.html: Added.
* web-platform-tests/wasm/jsapi/instance/exports.any.js: Added.
(setup):
(test):
* web-platform-tests/wasm/jsapi/instance/exports.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/instance/exports.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/instance/toString.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/instance/toString.any.html: Added.
* web-platform-tests/wasm/jsapi/instance/toString.any.js: Added.
(test):
* web-platform-tests/wasm/jsapi/instance/toString.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/instance/toString.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/instance/w3c-import.log: Added.
* web-platform-tests/wasm/jsapi/interface.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/interface.any.html: Added.
* web-platform-tests/wasm/jsapi/interface.any.js: Added.
(test_operations):
(test):
(const.name.of.interfaces.test):
* web-platform-tests/wasm/jsapi/interface.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/interface.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/memory/buffer.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/memory/buffer.any.html: Added.
* web-platform-tests/wasm/jsapi/memory/buffer.any.js: Added.
(test):
* web-platform-tests/wasm/jsapi/memory/buffer.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/memory/constructor.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/memory/constructor.any.html: Added.
* web-platform-tests/wasm/jsapi/memory/constructor.any.js: Added.
(assert_Memory):
(test):
(const.value.of.outOfRangeValues.test):
(test.get new):
(test.get assert_array_equals):
* web-platform-tests/wasm/jsapi/memory/constructor.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/memory/grow.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/memory/grow.any.html: Added.
* web-platform-tests/wasm/jsapi/memory/grow.any.js: Added.
(assert_ArrayBuffer):
(test):
(valueOf):
(const.value.of.outOfRangeValues.test):
* web-platform-tests/wasm/jsapi/memory/grow.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/memory/grow.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/memory/toString.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/memory/toString.any.html: Added.
* web-platform-tests/wasm/jsapi/memory/toString.any.js: Added.
(test):
* web-platform-tests/wasm/jsapi/memory/toString.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/memory/toString.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/memory/w3c-import.log: Added.
* web-platform-tests/wasm/jsapi/module/constructor.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/module/constructor.any.html: Added.
* web-platform-tests/wasm/jsapi/module/constructor.any.js: Added.
(setup):
(test):
* web-platform-tests/wasm/jsapi/module/constructor.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/module/constructor.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/module/customSections.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/module/customSections.any.html: Added.
* web-platform-tests/wasm/jsapi/module/customSections.any.js: Added.
(assert_ArrayBuffer):
(assert_sections):
(setup):
(test):
* web-platform-tests/wasm/jsapi/module/customSections.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/module/customSections.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/module/exports.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/module/exports.any.html: Added.
* web-platform-tests/wasm/jsapi/module/exports.any.js: Added.
(setup):
(assert_ModuleExportDescriptor):
(assert_exports):
(test):
* web-platform-tests/wasm/jsapi/module/exports.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/module/exports.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/module/imports.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/module/imports.any.html: Added.
* web-platform-tests/wasm/jsapi/module/imports.any.js: Added.
(assert_ModuleImportDescriptor):
(assert_imports):
(setup):
(test):
* web-platform-tests/wasm/jsapi/module/imports.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/module/imports.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/module/toString.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/module/toString.any.html: Added.
* web-platform-tests/wasm/jsapi/module/toString.any.js: Added.
(test):
* web-platform-tests/wasm/jsapi/module/toString.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/module/toString.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/module/w3c-import.log: Added.
* web-platform-tests/wasm/jsapi/table/assertions.js: Added.
(assert_equal_to_array):
* web-platform-tests/wasm/jsapi/table/constructor.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/table/constructor.any.html: Added.
* web-platform-tests/wasm/jsapi/table/constructor.any.js: Added.
(assert_Table):
(test):
(const.value.of.outOfRangeValues.test):
(test.get const):
* web-platform-tests/wasm/jsapi/table/constructor.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/table/constructor.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/table/get-set.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/table/get-set.any.html: Added.
* web-platform-tests/wasm/jsapi/table/get-set.any.js: Added.
(setup):
(test):
(test.set assert_equal_to_array):
(test.const.fn):
(valueOf):
(const.value.of.outOfRangeValues.test):
* web-platform-tests/wasm/jsapi/table/get-set.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/table/get-set.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/table/grow.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/table/grow.any.html: Added.
* web-platform-tests/wasm/jsapi/table/grow.any.js: Added.
(nulls):
(test):
(valueOf):
(const.value.of.outOfRangeValues.test):
* web-platform-tests/wasm/jsapi/table/grow.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/table/grow.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/table/length.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/table/length.any.html: Added.
* web-platform-tests/wasm/jsapi/table/length.any.js: Added.
(test):
* web-platform-tests/wasm/jsapi/table/length.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/table/length.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/table/toString.any-expected.txt: Added.
* web-platform-tests/wasm/jsapi/table/toString.any.html: Added.
* web-platform-tests/wasm/jsapi/table/toString.any.js: Added.
(test):
* web-platform-tests/wasm/jsapi/table/toString.any.worker-expected.txt: Added.
* web-platform-tests/wasm/jsapi/table/toString.any.worker.html: Added.
* web-platform-tests/wasm/jsapi/table/w3c-import.log: Added.
* web-platform-tests/wasm/jsapi/w3c-import.log: Added.
* web-platform-tests/wasm/jsapi/wasm-constants.js: Added.
(bytes):
(bytesWithHeader):
(makeSig):
(makeSig_v_x):
(makeSig_v_xx):
(makeSig_r_v):
(makeSig_r_x):
(makeSig_r_xx):
(assertTraps):
(assertWasmThrows):
* web-platform-tests/wasm/jsapi/wasm-module-builder.js: Added.
(Binary.prototype.emit_u8):
(Binary.prototype.emit_u16):
(Binary.prototype.emit_u32):
(Binary.prototype.emit_u32v):
(Binary.prototype.emit_bytes):
(Binary.prototype.emit_string):
(Binary.prototype.emit_header):
(Binary.prototype.emit_section):
(Binary):
(WasmFunctionBuilder):
(WasmFunctionBuilder.prototype.exportAs):
(WasmFunctionBuilder.prototype.exportFunc):
(WasmFunctionBuilder.prototype.addBody):
(WasmFunctionBuilder.prototype.addLocals):
(WasmFunctionBuilder.prototype.end):
(WasmGlobalBuilder):
(WasmGlobalBuilder.prototype.exportAs):
(WasmModuleBuilder):
(WasmModuleBuilder.prototype.addStart):
(WasmModuleBuilder.prototype.addMemory):
(WasmModuleBuilder.prototype.addExplicitSection):
(WasmModuleBuilder.prototype.addType):
(WasmModuleBuilder.prototype.addGlobal):
(WasmModuleBuilder.prototype.addFunction):
(WasmModuleBuilder.prototype.addImport):
(WasmModuleBuilder.prototype.addImportedGlobal):
(WasmModuleBuilder.prototype.addImportedMemory):
(WasmModuleBuilder.prototype.addImportedTable):
(WasmModuleBuilder.prototype.addExport):
(WasmModuleBuilder.prototype.addExportOfKind):
(WasmModuleBuilder.prototype.addDataSegment):
(WasmModuleBuilder.prototype.exportMemoryAs):
(WasmModuleBuilder.prototype.addFunctionTableInit):
(WasmModuleBuilder.prototype.appendToTable):
(WasmModuleBuilder.prototype.setFunctionTableLength):
(WasmModuleBuilder.prototype.toArray):
(WasmModuleBuilder.prototype.toBuffer):
(WasmModuleBuilder.prototype.instantiate):

Source/JavaScriptCore:

This patch fixes miscellaneous issues in our Wasm JS API implementation to improve WPT score.
I picked trivial ones in this patch to make this easily reviewable.

1. Remove WebAssemblyPrototype. It does not exist in the spec. Merging WebAssemblyPrototype into JSWebAssembly.
2. Fix various attributes. It does not match to the usual JSC builtin's convention. But this change
   is correct because they are changed to be matched against WebIDL definition, and WebAssembly implementation
   follows WebIDL. In the future, we could move WebCore WebIDL things into WTF layer and even use (or leverage
   some of utility functions) in our WebAssembly JS API implementation.
3. Fix how we interpret "present" in WebAssembly spec. This does not mean [[HasProperty]] result. It follows to
   WebIDL spec, and it means that [[Get]] result is not undefined.
4. Add argument count check to Module.customSections, which is required because the method is defined in WebIDL.
5. Fix toNonWrappingUint32 to match it to WebIDL's conversion rule.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* builtins/WebAssembly.js: Renamed from Source/JavaScriptCore/builtins/WebAssemblyPrototype.js.
* jit/Repatch.cpp:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSModuleLoader.cpp:
(JSC::moduleLoaderParseModule):
* wasm/js/JSWebAssembly.cpp:
(JSC::JSWebAssembly::create):
(JSC::JSWebAssembly::finishCreation):
(JSC::reject):
(JSC::webAssemblyModuleValidateAsyncInternal):
(JSC::webAssemblyCompileFunc):
(JSC::resolve):
(JSC::JSWebAssembly::webAssemblyModuleValidateAsync):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::JSWebAssembly::instantiate):
(JSC::webAssemblyModuleInstantinateAsyncInternal):
(JSC::JSWebAssembly::webAssemblyModuleInstantinateAsync):
(JSC::webAssemblyInstantiateFunc):
(JSC::webAssemblyValidateFunc):
(JSC::webAssemblyCompileStreamingInternal):
(JSC::webAssemblyInstantiateStreamingInternal):
* wasm/js/JSWebAssembly.h:
* wasm/js/JSWebAssemblyHelpers.h:
(JSC::toNonWrappingUint32):
* wasm/js/WebAssemblyCompileErrorConstructor.cpp:
(JSC::WebAssemblyCompileErrorConstructor::finishCreation):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::WebAssemblyInstanceConstructor::finishCreation):
* wasm/js/WebAssemblyInstancePrototype.cpp:
* wasm/js/WebAssemblyLinkErrorConstructor.cpp:
(JSC::WebAssemblyLinkErrorConstructor::finishCreation):
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::constructJSWebAssemblyMemory):
(JSC::WebAssemblyMemoryConstructor::finishCreation):
* wasm/js/WebAssemblyMemoryPrototype.cpp:
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::webAssemblyModuleCustomSections):
(JSC::WebAssemblyModuleConstructor::finishCreation):
* wasm/js/WebAssemblyPrototype.cpp: Removed.
* wasm/js/WebAssemblyPrototype.h: Removed.
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::WebAssemblyRuntimeErrorConstructor::finishCreation):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::constructJSWebAssemblyTable):
(JSC::WebAssemblyTableConstructor::finishCreation):
* wasm/js/WebAssemblyTablePrototype.cpp:

Source/WebCore:

Remove WebAssemblyPrototype.

Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
       imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
       imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::compileStreaming):
(WebCore::JSDOMWindowBase::instantiateStreaming):

LayoutTests:

* platform/ios-simulator/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@247457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JSTests/wasm/js-api/test_basic_api.js b/JSTests/wasm/js-api/test_basic_api.js
index 2158743..5e37210 100644
--- a/JSTests/wasm/js-api/test_basic_api.js
+++ b/JSTests/wasm/js-api/test_basic_api.js
@@ -78,7 +78,7 @@
         for (const invalid of invalidInstanceImports)
             assert.throws(() => new WebAssembly[c](new WebAssembly.Module(emptyModuleArray), invalid), TypeError, `second argument to WebAssembly.Instance must be undefined or an Object (evaluating 'new WebAssembly[c](new WebAssembly.Module(emptyModuleArray), invalid)')`);
         assert.isNotUndef(instance.exports);
-        checkAccessorOwnPropertyDescriptor(WebAssembly.Instance.prototype, "exports", { configurable: true, enumerable: false });
+        checkAccessorOwnPropertyDescriptor(WebAssembly.Instance.prototype, "exports", { configurable: true, enumerable: true });
         assert.throws(() => WebAssembly.Instance.prototype.exports = undefined, TypeError, `Attempted to assign to readonly property.`);
         assert.throws(() => WebAssembly.Instance.prototype.exports, TypeError, `expected |this| value to be an instance of WebAssembly.Instance`);
         assert.isUndef(instance.exports.__proto__);