]> git.kaiwu.me - njs.git/commitdiff
Removed unused null proto hash.
authorIgor Sysoev <igor@sysoev.ru>
Tue, 13 Mar 2018 16:51:25 +0000 (19:51 +0300)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 13 Mar 2018 16:51:25 +0000 (19:51 +0300)
njs/njs_builtin.c
njs/njs_object.c
njs/njs_vm.c
njs/njs_vm.h

index d4e6267aa87051f2767b087a5d2c8fe4ee1ae770..01c948f3d52711a59457f02f945257624f9386f0 100644 (file)
@@ -222,24 +222,12 @@ njs_builtin_objects_create(njs_vm_t *vm)
         { njs_memory_error_constructor,  { NJS_SKIP_ARG, NJS_STRING_ARG } },
     };
 
-    static const njs_object_prop_t    null_proto_property = {
-        .type = NJS_WHITEOUT,
-        .name = njs_string("__proto__"),
-        .value = njs_value(NJS_NULL, 0, 0.0),
-    };
-
     static const njs_object_prop_t    function_prototype_property = {
         .type = NJS_NATIVE_GETTER,
         .name = njs_string("prototype"),
         .value = njs_native_getter(njs_function_prototype_create),
     };
 
-    ret = njs_object_hash_create(vm, &vm->shared->null_proto_hash,
-                                 &null_proto_property, 1);
-    if (nxt_slow_path(ret != NXT_OK)) {
-        return NXT_ERROR;
-    }
-
     ret = njs_object_hash_create(vm, &vm->shared->function_prototype_hash,
                                  &function_prototype_property, 1);
     if (nxt_slow_path(ret != NXT_OK)) {
index 7f51f4fb93443cd127747f5b2ec7d95c89537130..614ada8e4971ccfeadc5a2fd18472ac24c500b2a 100644 (file)
@@ -299,7 +299,6 @@ njs_object_create(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
                 object->__proto__ = args[1].data.u.object;
 
             } else {
-                object->shared_hash = vm->shared->null_proto_hash;
                 object->__proto__ = NULL;
             }
 
index f8e39719e9c373a4034fd9f1b06632baa9024db1..7e8ff99674839d26102d70c2606c736b68799cac 100644 (file)
@@ -1198,11 +1198,6 @@ njs_object_property_query(njs_vm_t *vm, njs_property_query_t *pq,
 
             case NJS_PROPERTY_QUERY_IN:
                 prop = pq->lhq.value;
-
-                if (prop->type == NJS_WHITEOUT) {
-                    return NXT_DECLINED;
-                }
-
                 break;
             }
 
index 871aeaf551c3bf063a2d83083b4693182a885c11..58c9b055979b8ba813623eef45631919101c8002 100644 (file)
@@ -1022,7 +1022,6 @@ typedef struct {
 struct njs_vm_shared_s {
     nxt_lvlhsh_t             keywords_hash;
     nxt_lvlhsh_t             values_hash;
-    nxt_lvlhsh_t             null_proto_hash;
     nxt_lvlhsh_t             function_prototype_hash;
 
     njs_object_t             objects[NJS_OBJECT_MAX];