Unfortunately there are two problems with dropping the brackets:
-
List ambiguity -
JS.call(:obj, :processList, [1, 2, 3])becomes impossible to distinguish between one argument (the array[1, 2, 3]) and three separate arguments. -
Arity clash -
JS.call/2calls a standalone function,JS.call/3calls a method on a receiver. If args were optional,JS.call(:Decimal, :toNumber)could be eithercall/2with one arg orcall/3with no args.
The explicit args list is also consistent with Kernel.apply/3, which always requires the args list. I actually considered naming it JS.apply at one point, so the parallel is intentional.






















