]> git.kaiwu.me - njs.git/commit
Fixed function "prototype" property handler while setting.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 18 Aug 2020 16:53:46 +0000 (16:53 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 18 Aug 2020 16:53:46 +0000 (16:53 +0000)
commit41b49c3f49255cacf103a0e21ecdffaf61c8074c
tree1db925d16887d54e881de7c1e2afb5e21fde4829
parent1a2ebf4718c6c8a7785351ffc5b9b356038076db
Fixed function "prototype" property handler while setting.

njs_function_prototype_create() works as a getter and setter.  As a
getter the function is expected to create "prototype" property on the
first access, it also sets F.prototype.constructor property to ensure
F.prototype.constructor === F.

Setting of "constructor" property is not needed in setter context, as
it may overwrite existing "constructor" property in setval.

This closes #333 issue on Github.
src/njs_function.c
src/test/njs_unit_test.c