There's no reason to check both flags when one depends on another.
See just a few lines above: function->ctor = !lambda->arrow.
Now the condition is made similar to the one in njs_method_private_copy().
function->args_offset = 1;
function->u.lambda = lambda;
- if (lambda->arrow || !function->ctor) {
- function->object.shared_hash = vm->shared->arrow_instance_hash;
+ if (function->ctor) {
+ function->object.shared_hash = vm->shared->function_instance_hash;
} else {
- function->object.shared_hash = vm->shared->function_instance_hash;
+ function->object.shared_hash = vm->shared->arrow_instance_hash;
}
function->object.__proto__ = &vm->prototypes[NJS_PROTOTYPE_FUNCTION].object;