From e76b335cff0527b7d978b3c19aca77c9aa8adf1f Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Tue, 21 Dec 2021 15:48:45 +0000 Subject: [PATCH] Added constructor flag for methods in external prototypes. --- src/njs.h | 1 + src/njs_extern.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/njs.h b/src/njs.h index a307a997..907950a4 100644 --- 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 { diff --git a/src/njs_extern.c b/src/njs_extern.c index 4a56551e..51121df4 100644 --- a/src/njs_extern.c +++ b/src/njs_extern.c @@ -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); -- 2.47.3