[njs] Added constructor flag for methods in external prototypes.

Dmitry Volyntsev xeioex at nginx.com
Tue Dec 21 17:45:59 UTC 2021


details:   https://hg.nginx.org/njs/rev/3c28224a8f79
branches:  
changeset: 1768:3c28224a8f79
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Dec 21 15:48:45 2021 +0000
description:
Added constructor flag for methods in external prototypes.

diffstat:

 src/njs.h        |  1 +
 src/njs_extern.c |  3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r 659995ad4f97 -r 3c28224a8f79 src/njs.h
--- a/src/njs.h	Tue Dec 14 20:14:23 2021 +0000
+++ b/src/njs.h	Tue Dec 21 15:48:45 2021 +0000
@@ -137,6 +137,7 @@ struct njs_external_s {
         struct {
             njs_function_native_t   native;
             uint8_t                 magic8;
+            uint8_t                 ctor;
         } method;
 
         struct {
diff -r 659995ad4f97 -r 3c28224a8f79 src/njs_extern.c
--- a/src/njs_extern.c	Tue Dec 14 20:14:23 2021 +0000
+++ b/src/njs_extern.c	Tue Dec 21 15:48:45 2021 +0000
@@ -79,8 +79,9 @@ njs_external_add(njs_vm_t *vm, njs_arr_t
             function->object.extensible = 1;
             function->args_offset = 1;
             function->native = 1;
+            function->u.native = external->u.method.native;
             function->magic8 = external->u.method.magic8;
-            function->u.native = external->u.method.native;
+            function->ctor = external->u.method.ctor;
 
             njs_set_function(&prop->value, function);
 


More information about the nginx-devel mailing list