On Feb 20, 2014, at 7:49 AM, Boris Zbarsky wrote:

> Consider 
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.splice
>  step 10.  It uses the phrasing "if deleteCount is not present" but I can't 
> find anything in the specification defining the concept of "present" or "not 
> present".  So it's hard for me to tell what behavior this is actually 
> defining.
> 
> Is this supposed to be a typeof(deleteCount) == "undefined" test, an argc 
> test, or something else?
> 
> I'm assuming it's supposed to be the typeof() == "undefined" test, but this 
> should actually be specified somewhere.  Perhaps as a definition in section 
> 4.3?

Nope, it means that the length of the argument list is less than two, hence an 
argument corresponding to 'deleteCount' was not passed.

http://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-standard-built-in-objects
 (para 4) says: "Unless otherwise specified in the description of a particular 
function, if a built-in function or constructor is given fewer arguments than 
the function is specified to require, the function or constructor shall behave 
exactly as if it had been given sufficient additional arguments, each such 
argument being the undefined value."

So, "is not present" is how handling of missing arguments is "otherwise 
specified".

If the algorithm need to simply test for an explicitly or implicitly passed 
undefined, it would simply say "If argument is undefined, then ..."

I always thought "not present" was sufficiently descriptive, in combination 
with the missing args default to undefined rule, that it didn't need further 
definition.

Allen







> 
> -Boris
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
> 

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to