On Nov 10, 2013, at 12:52 PM, Oliver Hunt wrote: > I don’t fully understand this — what is the reason for needing to know actual > argument count? The historical reason was that if i have a var arg function > with a few required parameters i don’t have any nice way of iterating the > optional args. > > Default and rest parameters seem to solve this use case.
The legacy reason is that there are existing APIs that were probably originally implemented in C++ where the behavior of the function was determined by the number of passed arguments rather than by their actual values. The continuing reason is that WebIDL overloading model encourages people to design new APIs that have that same characteristic. And so far, nobody has convinced the WebIDL maintainers to abandon such overloading as a specification technique. Allen _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss