[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/+/3071405 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Thibaud Michaud <thibaudm@chromium.org> Cr-Commit-Position: refs/heads/master@{#76109}
This commit is contained in:
parent
2ae50a3458
commit
51f566481d
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user