details:   
https://github.com/nginx/njs/commit/02ccc1168c41014bcc267fe932afd34ce63c7f55
branches:  master
commit:    02ccc1168c41014bcc267fe932afd34ce63c7f55
user:      hongzhidao <hongzhi...@gmail.com>
date:      Mon, 24 Mar 2025 15:40:15 +0800
description:
QuickJS: added missed JS_NewClass() for the SharedDictError class.


---
 nginx/ngx_js_shared_dict.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/nginx/ngx_js_shared_dict.c b/nginx/ngx_js_shared_dict.c
index 7f8c808e..c0928088 100644
--- a/nginx/ngx_js_shared_dict.c
+++ b/nginx/ngx_js_shared_dict.c
@@ -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;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to