Object.is steps are very thing
allen at wirfs-brock.com
Sat Mar 16 16:06:32 PDT 2013
On Mar 16, 2013, at 3:40 PM, David Bruant wrote:
> Le 16/03/2013 19:18, Tom Schuster a écrit :
>> Looking at the the steps for Object.is the first sentence just says:
>>> "When the is function is called with arguments value1 and value2 the following steps are taken:"
>> I don't remember other functions being defined like that. It should at
>> least say something along the lines of
>> "When called with less than 2 parameters return false."
> I'd throw a TypeError. Calling Object.is with strictly more or less than 2 parameters is most likely an error, akin to === with which something different than strictly 2 operands resultsis a SyntaxError.
ECMAScript has a well established convention of using undefined for any non-supplied argument values. It's preferable to consistently follow such conventions.
More information about the es-discuss