Commit 51f56648 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by V8 LUCI CQ

[wasm][eh] Add WebAssembly.Tag.toStringTag()

R=jkummerow@chromium.org

Bug: v8:11992
Change-Id: I4229a6fff8d956a5baa9ab9d5028f9abc20d4039
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071405Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76109}
parent 2ae50a34
......@@ -2627,6 +2627,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) {
JSFunction::EnsureHasInitialMap(tag_constructor);
Handle<JSObject> tag_proto(
JSObject::cast(tag_constructor->instance_prototype()), isolate);
JSObject::AddProperty(isolate, tag_proto, factory->to_string_tag_symbol(),
v8_str(isolate, "WebAssembly.Tag"), ro_attributes);
if (enabled_features.has_type_reflection()) {
InstallFunc(isolate, tag_proto, "type", WebAssemblyTagType, 0);
}
......
......@@ -30,6 +30,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
assertThrows(
() => builder.instantiate({ m: { ex: js_except_v }}), WebAssembly.LinkError,
/imported tag does not match the expected type/);
assertTrue(js_except_i32.toString() == "[object WebAssembly.Tag]");
})();
(function TestExport() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment