]> git.kaiwu.me - njs.git/commit
Externals refactored.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 20 Feb 2018 16:12:53 +0000 (19:12 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 20 Feb 2018 16:12:53 +0000 (19:12 +0300)
commit71c34dc00d6249c9aed6ccedd1b760fe8ff23a50
tree649b9853f8007de730d8183ce81b55944e5756a9
parent34208fa54fe218d993942e79205e4a6fb727777c
Externals refactored.

Public API is rectified to allow the creation of external objects in
runtime.
    1) njs_vm_external_add() is replaced with njs_vm_external_prototype().
    The later functions returns a pointer to a prototype object which can
    be used to create a value with such a prototype in runtime.

    2) njs_vm_external() is split into njs_vm_external_create() and
    njs_vm_external_bind(). The former creates a variable with a specified
    prototype and associates it with an external pointer. The latter binds
    a variable to a name in the global namespace.
18 files changed:
nginx/ngx_http_js_module.c
nginx/ngx_stream_js_module.c
njs/njs.c
njs/njs_builtin.c
njs/njs_extern.c
njs/njs_extern.h
njs/njs_parser.c
njs/njs_parser.h
njs/njs_vm.c
njs/njs_vm.h
njs/njscript.c
njs/njscript.h
njs/test/njs_benchmark.c
njs/test/njs_interactive_test.c
njs/test/njs_unit_test.c
nxt/nxt_array.h
nxt/nxt_lvlhsh.c
nxt/nxt_lvlhsh.h