when creating a new function in v8, one can pass a length parameter (docs). But I couldn't find out what it is good for as it does not seem to have any direct effect...
v8::Function::New(ctx, callback, data, length);
JavaScript functions have a length
property:
function foo(a, b, c) {}
var len = foo.length; // 3
When you create a function on the C++ side, the length
parameter to v8::Function::New
(or v8::FunctionTemplate::New
) allows you to specify the value of the resulting function's length
property.