@@ -3119,6 +3119,15 @@ void WebAssemblyExceptionIsImpl(
31193119 info.GetReturnValue ().Set (tag_object->tag () == *tag);
31203120}
31213121
3122+ void WebAssemblyExceptionGetStackImpl (
3123+ const v8::FunctionCallbackInfo<v8::Value>& info) {
3124+ WasmJSApiScope js_api_scope{info, " WebAssembly.Exception.stack()" };
3125+ auto [isolate, i_isolate, thrower] = js_api_scope.isolates_and_thrower ();
3126+ EXTRACT_THIS (exception, WasmExceptionPackage);
3127+
3128+ info.GetReturnValue ().Set (v8::Undefined (isolate));
3129+ }
3130+
31223131void WebAssemblyGlobalGetValueCommon (WasmJSApiScope& js_api_scope) {
31233132 auto [isolate, i_isolate, thrower] = js_api_scope.isolates_and_thrower ();
31243133 auto & info = js_api_scope.callback_info (); // Needed by EXTRACT_THIS.
@@ -3562,6 +3571,7 @@ void WasmJs::PrepareForSnapshot(Isolate* isolate) {
35623571 {
35633572 DirectHandle<JSFunction> exception_constructor = InstallConstructorFunc (
35643573 isolate, webassembly, " Exception" , wasm::WebAssemblyException);
3574+ exception_constructor->shared ()->set_length (2 );
35653575 SetDummyInstanceTemplate (isolate, exception_constructor);
35663576 DirectHandle<JSObject> exception_proto = SetupConstructor (
35673577 isolate, exception_constructor, WASM_EXCEPTION_PACKAGE_TYPE,
@@ -3571,6 +3581,8 @@ void WasmJs::PrepareForSnapshot(Isolate* isolate) {
35713581 wasm::WebAssemblyExceptionGetArg, 2 );
35723582 InstallFunc (isolate, exception_proto, " is" , wasm::WebAssemblyExceptionIs,
35733583 1 );
3584+ InstallGetter (isolate, exception_proto, " stack" ,
3585+ wasm::WebAssemblyExceptionGetStack);
35743586 native_context->set_wasm_exception_constructor (*exception_constructor);
35753587
35763588 DirectHandle<Map> initial_map (exception_constructor->initial_map (),
0 commit comments