[Bug 23532] Dealing with undefined

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532

--- Comment #24 from James Graham <james@hoppipolla.co.uk> ---
I am extremely skeptical of any claim that, given a function domFoo that takes
a single non-optional, argument, js programmers benefit more from consistency
between domFoo() and domFoo(undefined) than they do from throwing when the
argument is missing. It seems far more likely to me that users missing
non-optional arguments have made a mistake than that they are deliberately
trying to invoke the effect of passing undefined, not least because the effect
of passing undefined itself is often rather useless, and leads to a bad result
(NaN, "undefined", null, etc.) which then propagates through the rest of the
code making it extremely difficult to locate the original source of the bug.

Unless anyone has any concrete evidence that my suppositions above are
incorrect, I oppose removing throwing behavior from legacy APIs and suggest
throwing in both cases in future APIs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Wednesday, 23 October 2013 21:36:09 UTC