Skip to content
File

Blob: patches/v8/0026-Implement-additional-Exception-construction-methods.patch

2.8 KB
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: James M Snell <jsnell@cloudflare.com>
3Date: Tue, 1 Jul 2025 17:33:43 -0700
4Subject: Implement additional Exception construction methods
5 
6Signed-off-by: James M Snell <jsnell@cloudflare.com>
7 
8diff --git a/include/v8-exception.h b/include/v8-exception.h
9index f240d9a609e92b4a3055256996ad69d8fc14ac49..f8546f34d207e4e2e6fd1c5d8b87b83b956e4e23 100644
10--- a/include/v8-exception.h
11+++ b/include/v8-exception.h
12@@ -48,6 +48,14 @@ class V8_EXPORT Exception {
13 static Local<Value> WasmSuspendError(Local<String> message,
14 Local<Value> options = {});
15 static Local<Value> Error(Local<String> message, Local<Value> options = {});
16+ static Local<Value> URIError(Local<String> message,
17+ Local<Value> options = {});
18+ static Local<Value> EvalError(Local<String> message,
19+ Local<Value> options = {});
20+ static Local<Value> AggregateError(Local<String> message,
21+ Local<Value> options = {});
22+ static Local<Value> SuppressedError(Local<String> message,
23+ Local<Value> options = {});
24
25 /**
26 * Creates an error message for the given exception.
27diff --git a/src/api/api.cc b/src/api/api.cc
28index e5c24959acc33dd61f42afee2c81d19e3d8332a2..8afb25744487519738fd58f49f197537ef070b4a 100644
29--- a/src/api/api.cc
30+++ b/src/api/api.cc
31@@ -11328,6 +11328,10 @@ DEFINE_ERROR(WasmCompileError, wasm_compile_error)
32 DEFINE_ERROR(WasmLinkError, wasm_link_error)
33 DEFINE_ERROR(WasmRuntimeError, wasm_runtime_error)
34 DEFINE_ERROR(WasmSuspendError, wasm_suspend_error)
35+DEFINE_ERROR(EvalError, eval_error)
36+DEFINE_ERROR(URIError, uri_error)
37+DEFINE_ERROR(AggregateError, aggregate_error)
38+DEFINE_ERROR(SuppressedError, suppressed_error)
39 DEFINE_ERROR(Error, error)
40
41 #undef DEFINE_ERROR
42diff --git a/src/logging/runtime-call-stats.h b/src/logging/runtime-call-stats.h
43index 563e98a72dc1d76fce0b625291114a51621b46c6..9079c08dab9f66ee4ec7872ad4b409d3c63ead7e 100644
44--- a/src/logging/runtime-call-stats.h
45+++ b/src/logging/runtime-call-stats.h
46@@ -219,7 +219,11 @@ namespace v8::internal {
47 V(WeakMap_Delete) \
48 V(WeakMap_Get) \
49 V(WeakMap_New) \
50- V(WeakMap_Set)
51+ V(WeakMap_Set) \
52+ V(EvalError_New) \
53+ V(URIError_New) \
54+ V(AggregateError_New) \
55+ V(SuppressedError_New)
56
57 #define ADD_THREAD_SPECIFIC_COUNTER(V, Prefix, Suffix) \
58 V(Prefix##Suffix) \