On 11/11/13 1:22 AM, Jonas Sicking wrote:
I think the number is very low. I think I've heard of a total of four
DOM functions which currently treat "not passed" as different from
"explicitly passed undefined". And we're working on changing those so
that the two are treated the same. Unclear if we'll be able to change
all of them.
This is not true at all.
You're thinking of the few cases that have a "optional boolean foo =
true" argument but depend on explicit undefined being treated as false.
And even there we know for a fact that we can't change at least one of
then (XMLHttpRequest.open).
But there are more APIs that treat "not passed" as different from
"undefined" that don't involve default values.
CanvasRenderingContext2D.drawImage is a prime example. So, I suspect,
is CanvasRenderingContext2D.putImageData. Probably others too; I
haven't done an exhaustive search.
So from the DOM point of view, I don't see a lot of reason to add
convenience capabilities for detecting that difference.
Well, to the extent that we're not self-hosting the DOM implementation,
sure. I mean, for the specific case of SpiderMonkey we get an
args.length() no matter what in a JSNative, so obviously we don't have
to care too much about whether that's possible in the language itself
from that point of view. But that seems a bit shortsighted to me.
And in none of the cases in the DOM, does function.length become a
problem.
Well, largely because that's so busted in DOM implementations and specs
anyway. ;)
-Boris
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss