]> git.kaiwu.me - njs.git/commitdiff
QuickJS: added missed JS_NewClass() for the SharedDictError class.
authorhongzhidao <hongzhidao@gmail.com>
Mon, 24 Mar 2025 07:40:15 +0000 (15:40 +0800)
committerDmitry Volyntsev <xeioexception@gmail.com>
Mon, 24 Mar 2025 22:57:43 +0000 (15:57 -0700)
nginx/ngx_js_shared_dict.c

index 7f8c808e81d3d7f2e27e2f3fc90325ca343f0329..c092808816ed1bf3ea04436d874556ec4205429d 100644 (file)
@@ -465,6 +465,11 @@ static JSClassDef ngx_qjs_shared_class = {
     },
 };
 
+static JSClassDef ngx_qjs_shared_dict_error_class = {
+    "SharedDictError",
+    .finalizer = NULL,
+};
+
 qjs_module_t  ngx_qjs_ngx_shared_dict_module = {
     .name = "shared_dict",
     .init = ngx_qjs_ngx_shared_dict_init,
@@ -3001,6 +3006,12 @@ ngx_qjs_ngx_shared_dict_init(JSContext *cx, const char *name)
         return NULL;
     }
 
+    if (JS_NewClass(JS_GetRuntime(cx), NGX_QJS_CLASS_ID_SHARED_DICT_ERROR,
+                    &ngx_qjs_shared_dict_error_class) < 0)
+    {
+        return NULL;
+    }
+
     proto = JS_NewObject(cx);
     if (JS_IsException(proto)) {
         return NULL;