[njs] Changed njs_object_prop_define() prototype.

Dmitry Volyntsev xeioex at nginx.com
Tue Jun 18 17:41:47 UTC 2019


details:   https://hg.nginx.org/njs/rev/4d21c3e3807f
branches:  
changeset: 1009:4d21c3e3807f
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Jun 18 20:27:25 2019 +0300
description:
Changed njs_object_prop_define() prototype.

diffstat:

 njs/njs_object.c          |  5 ++---
 njs/njs_object.h          |  2 +-
 njs/njs_object_property.c |  4 ++--
 3 files changed, 5 insertions(+), 6 deletions(-)

diffs (55 lines):

diff -r e18ee27ce760 -r 4d21c3e3807f njs/njs_object.c
--- a/njs/njs_object.c	Tue Jun 18 17:57:38 2019 +0300
+++ b/njs/njs_object.c	Tue Jun 18 20:27:25 2019 +0300
@@ -1138,7 +1138,7 @@ njs_object_define_property(njs_vm_t *vm,
 
     name = njs_arg(args, nargs, 2);
 
-    ret = njs_object_prop_define(vm, value, name, descriptor->data.u.object);
+    ret = njs_object_prop_define(vm, value, name, descriptor);
     if (nxt_slow_path(ret != NXT_OK)) {
         return NXT_ERROR;
     }
@@ -1192,8 +1192,7 @@ njs_object_define_properties(njs_vm_t *v
         }
 
         if (prop->enumerable && njs_is_object(&prop->value)) {
-            ret = njs_object_prop_define(vm, value, &prop->name,
-                                      prop->value.data.u.object);
+            ret = njs_object_prop_define(vm, value, &prop->name, &prop->value);
 
             if (nxt_slow_path(ret != NXT_OK)) {
                 return NXT_ERROR;
diff -r e18ee27ce760 -r 4d21c3e3807f njs/njs_object.h
--- a/njs/njs_object.h	Tue Jun 18 17:57:38 2019 +0300
+++ b/njs/njs_object.h	Tue Jun 18 20:27:25 2019 +0300
@@ -117,7 +117,7 @@ njs_object_prop_t *njs_object_prop_alloc
 njs_object_prop_t *njs_object_property(njs_vm_t *vm, const njs_object_t *obj,
     nxt_lvlhsh_query_t *lhq);
 njs_ret_t njs_object_prop_define(njs_vm_t *vm, njs_value_t *object,
-    const njs_value_t *name, const njs_object_t *descriptor);
+    const njs_value_t *name, const njs_value_t *value);
 njs_ret_t njs_object_prop_descriptor(njs_vm_t *vm, njs_value_t *dest,
     const njs_value_t *value, const njs_value_t *property);
 njs_ret_t njs_prop_private_copy(njs_vm_t *vm, njs_property_query_t *pq);
diff -r e18ee27ce760 -r 4d21c3e3807f njs/njs_object_property.c
--- a/njs/njs_object_property.c	Tue Jun 18 17:57:38 2019 +0300
+++ b/njs/njs_object_property.c	Tue Jun 18 20:27:25 2019 +0300
@@ -749,7 +749,7 @@ njs_object_property(njs_vm_t *vm, const 
  */
 njs_ret_t
 njs_object_prop_define(njs_vm_t *vm, njs_value_t *object,
-    const njs_value_t *name, const njs_object_t *descriptor)
+    const njs_value_t *name, const njs_value_t *value)
 {
     nxt_int_t             ret;
     njs_object_prop_t     *desc, *current;
@@ -767,7 +767,7 @@ njs_object_prop_define(njs_vm_t *vm, njs
         return ret;
     }
 
-    desc = njs_descriptor_prop(vm, name, descriptor);
+    desc = njs_descriptor_prop(vm, name, value->data.u.object);
     if (nxt_slow_path(desc == NULL)) {
         return NXT_ERROR;
     }


More information about the nginx-devel mailing list