Skip to content

Commit

Permalink
Bug 1806994 - Define @@toStringTag on the WebAssembly namespace objec…
Browse files Browse the repository at this point in the history
…t. r=rhunt

Namespace objects have a class string (https://webidl.spec.whatwg.org/#ref-for-dfn-class-string⑨)
so they need to have a @@toStringTag property (https://webidl.spec.whatwg.org/#ref-for-dfn-class-string).

Differential Revision: https://phabricator.services.mozilla.com/D165458
  • Loading branch information
petervanderbeken committed Jan 9, 2023
1 parent 81fb076 commit cc44fed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 51 deletions.
14 changes: 7 additions & 7 deletions js/src/wasm/WasmJS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5334,6 +5334,9 @@ static const JSFunctionSpec WebAssembly_static_methods[] = {
JSPROP_ENUMERATE),
JS_FS_END};

static const JSPropertySpec WebAssembly_static_properties[] = {
JS_STRING_SYM_PS(toStringTag, "WebAssembly", JSPROP_READONLY), JS_PS_END};

static JSObject* CreateWebAssemblyObject(JSContext* cx, JSProtoKey key) {
MOZ_RELEASE_ASSERT(HasSupport(cx));

Expand Down Expand Up @@ -5414,13 +5417,10 @@ static bool WebAssemblyClassFinish(JSContext* cx, HandleObject object,
return true;
}

static const ClassSpec WebAssemblyClassSpec = {CreateWebAssemblyObject,
nullptr,
WebAssembly_static_methods,
nullptr,
nullptr,
nullptr,
WebAssemblyClassFinish};
static const ClassSpec WebAssemblyClassSpec = {
CreateWebAssemblyObject, nullptr, WebAssembly_static_methods,
WebAssembly_static_properties, nullptr, nullptr,
WebAssemblyClassFinish};

const JSClass js::WasmNamespaceObject::class_ = {
js_WebAssembly_str, JSCLASS_HAS_CACHED_PROTO(JSProto_WebAssembly),
Expand Down

This file was deleted.

0 comments on commit cc44fed

Please sign in to comment.