Commit 070159f3 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] Install the exception constructor in InstallConditionalFeatures

When copying the setup of the WebAssembly.Exception constructor to
InstallConditionalFeatures, I forgot to copy some parts.

R=thibaudm@chromium.org

Bug: chromium:1191853
Change-Id: Iacba30b3356fc42b7d97f8c105ef91b776b95eb4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2786853Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73671}
parent 9eba2d85
......@@ -2329,6 +2329,16 @@ void WasmJs::InstallConditionalFeatures(Isolate* isolate,
exception_constructor->shared().set_length(1);
JSObject::AddProperty(isolate, webassembly, exception_name,
exception_constructor, DONT_ENUM);
// Install the constructor on the context.
context->set_wasm_exception_constructor(*exception_constructor);
SetDummyInstanceTemplate(isolate, exception_constructor);
JSFunction::EnsureHasInitialMap(exception_constructor);
Handle<JSObject> exception_proto(
JSObject::cast(exception_constructor->instance_prototype()), isolate);
Handle<Map> exception_map = isolate->factory()->NewMap(
i::WASM_EXCEPTION_OBJECT_TYPE, WasmExceptionObject::kHeaderSize);
JSFunction::SetInitialMap(isolate, exception_constructor, exception_map,
exception_proto);
}
}
}
......
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