The current draft makes heavy use of Node.js's house delicacy, middle-variadic function signatures. This necessitates some untangling in argument parsing, particularly when combined with optional arguments, and is also not expressible in the IDL, leading to the vast majority of functions having a rather ugly any... in their IDL definition.
IDL does allow for overloads, so instead of, for example,
pipeTo(source[, ...transforms], writer[, options])
one could instead have
pipeTo(source[, transforms], writer[, options])
accurately representable in the IDL as
Promise<unsigned long long> pipeTo(any source, Writer writer, optional PipeToOptions options);
Promise<unsigned long long> pipeTo(any source, sequence<any> transforms, Writer writer, optional PipeToOptions options);
This would simplify argument parsing, and is arguably more "webby".
The current draft makes heavy use of Node.js's house delicacy, middle-variadic function signatures. This necessitates some untangling in argument parsing, particularly when combined with optional arguments, and is also not expressible in the IDL, leading to the vast majority of functions having a rather ugly
any...in their IDL definition.IDL does allow for overloads, so instead of, for example,
one could instead have
accurately representable in the IDL as
This would simplify argument parsing, and is arguably more "webby".