]> git.kaiwu.me - njs.git/commitdiff
Added constructor flag for methods in external prototypes.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 21 Dec 2021 15:48:45 +0000 (15:48 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 21 Dec 2021 15:48:45 +0000 (15:48 +0000)
src/njs.h
src/njs_extern.c

index a307a99746dfe4b2db547e716cdeaf807c938063..907950a4b5616e69f51edc7247a1f4ffb73995b7 100644 (file)
--- a/src/njs.h
+++ b/src/njs.h
@@ -137,6 +137,7 @@ struct njs_external_s {
         struct {
             njs_function_native_t   native;
             uint8_t                 magic8;
+            uint8_t                 ctor;
         } method;
 
         struct {
index 4a56551e7add70287bf37828cd75bebbcf3c656b..51121df4596c2b118b188db2e9678b5af00150a4 100644 (file)
@@ -79,8 +79,9 @@ njs_external_add(njs_vm_t *vm, njs_arr_t *protos,
             function->object.extensible = 1;
             function->args_offset = 1;
             function->native = 1;
-            function->magic8 = external->u.method.magic8;
             function->u.native = external->u.method.native;
+            function->magic8 = external->u.method.magic8;
+            function->ctor = external->u.method.ctor;
 
             njs_set_function(&prop->value, function);