]> git.kaiwu.me - njs.git/commit
Object property quering is refactored.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 19 Oct 2018 17:52:57 +0000 (20:52 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 19 Oct 2018 17:52:57 +0000 (20:52 +0300)
commit075bf7f4fc091b01e215b83c2721e755fb096acd
tree79b1a8aea2cf8754d9f1547f9436a5d91b07c6bb
parentc2564b7d6f7876f95f6ff9b5fa09b08df00a950c
Object property quering is refactored.

    njs_property_query() is rectified and unified
        1) returns only property descriptors. Special return codes
        NJS_PRIMITIVE_VALUE, NJS_STRING_VALUE, NJS_ARRAY_VALUE and
        NJS_EXTERNAL_VALUE are replaced with a temporary property
        descriptor of type NJS_PROPERTY_REF or NJS_PROPERTY_HANDLER.
        If NJS_PROPERTY_REF is set reference to a value is contained
        in prop->value.data.u.value.

        2) NJS_PROPERTY_HANDLER properties returned as is.

        3) njs_property_query_t.own can be used to query for an object's
            OwnProperty.

        4) NJS_PROPERTY_QUERY_IN is removed.

        The aim is to implement with it [[GetOwnProperty]] and
        [[GetProperty]] methods from specification. Which are used
        extensively in many places of the ECMAScript spec.

    njs_value_property() is introduced which corresponds to [[Get]]
    method from specification.

    This fixes #32 and #34 issues on Github.
njs/njs_extern.h
njs/njs_object.c
njs/njs_object.h
njs/njs_vm.c
njs/njs_vm.h
njs/test/njs_expect_test.exp
njs/test/njs_unit_test.c