]> git.kaiwu.me - njs.git/commitdiff
Simplified njs_object_prop_t.
authorVadim Zhestikov <v.zhestikov@f5.com>
Fri, 6 Jun 2025 23:45:15 +0000 (16:45 -0700)
committerVadimZhestikov <108960056+VadimZhestikov@users.noreply.github.com>
Thu, 3 Jul 2025 16:34:25 +0000 (09:34 -0700)
Removed enum_in_object_hash which is only set when prop->type is
NJS_WHITEOUT and this check can be used instead.

src/njs_object.c
src/njs_object_prop.c
src/njs_value.c
src/njs_value.h

index 632736283bac3ff08341c49a9938df7795608714..dec312c5b43a1d91d3b7d40a9184381e03a0d143 100644 (file)
@@ -993,13 +993,7 @@ njs_get_own_ordered_keys(njs_vm_t *vm, const njs_object_t *object,
 
                 njs_object_prop_t *hash_prop = lhq.value;
 
-                /* select names of prop which are not deleted and
-                 * not deleted and created again i.e.,
-                 * they are replaced shared hash props
-                 */
-                if (hash_prop->type != NJS_WHITEOUT &&
-                    !(hash_prop->enum_in_object_hash))
-                {
+                if (hash_prop->type != NJS_WHITEOUT) {
                     njs_process_prop(vm, &prop_name, flags, items_string,
                                      items_symbol);
                 }
@@ -1060,8 +1054,7 @@ local_hash:
             } else {
                 /* prop is:  in_hash && in_shared_hash */
 
-                /* select names of not deleted and created again */
-                if (prop->enum_in_object_hash) {
+                if (prop->type == NJS_WHITEOUT) {
                     njs_process_prop(vm, &prop_name, flags, items_string,
                                      items_symbol);
                 }
index d7c55d3ae15e131a7ffaaa9f25464eca47967316..275cd9acc7f2d032f6d655c479a2bbfc000d6d97 100644 (file)
@@ -58,7 +58,6 @@ njs_object_prop_alloc2(njs_vm_t *vm,
     }
 
     prop->type = type;
-    prop->enum_in_object_hash = 0;
 
     if (flags != NJS_OBJECT_PROP_UNSET) {
         prop->enumerable = !!(flags & NJS_OBJECT_PROP_ENUMERABLE);
index fe64afe6ee693d428f7d344c34eaf62f9a4fbb21..92c87e85233a70599539d52557ec4a0b4a8e8467 100644 (file)
@@ -1452,7 +1452,6 @@ slow_path:
     }
 
     prop->type = NJS_WHITEOUT;
-    prop->enum_in_object_hash = 1;
 
     return NJS_OK;
 }
index 7bc9eff3e2233843c66482616594a20a976a2da3..da53f15892e715dacba06585516df585d0301b38 100644 (file)
@@ -339,7 +339,6 @@ struct njs_object_prop_s {
 #define njs_prop_setter(_p)     (_p)->u.accessor.setter
 
     njs_object_prop_type_t      type:8;          /* 3 bits */
-    njs_object_prop_type_t      enum_in_object_hash:8; /* 3 bits */
 
     njs_object_attribute_t      writable:8;      /* 2 bits */
     njs_object_attribute_t      enumerable:8;    /* 2 bits */