Per definition, rest parameters always need to be at the end of a
FormalParameterList. I was wondering if this limitation could be liftet.
Use-case: Most SQL libraries for node support passing query arguments to
the query function (so SQL injections are avoided). The usual syntax
is db.run("SELECT
* FROM t WHERE foo=? AND cbar=?", "bar", "cfoo", function(err, row){…});
The number of arguments passed after the query depends on the number of
question marks inside the query. It would be nice when an implementation
could simply write db.run = function(query, ...params, cb){…} and avoid
using the arguments object or Array#poping the last element of params.
This change would require two additions: Every Identifier past rest can't
be another rest parameter or have a default value specified.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss