On Nov 5, 2010, at 10:30 AM, Jon Zeppieri wrote:

> But... I hadn't realized that the spread proposal already included 
> array-likes. In that case, there is no symmetry to preserve. The (now badly 
> misnamed) id function will produce an array from an array-like -- and from 
> null or undefined, under plan B. I think that second part feels a bit hack-y, 
> and as Brendan pointed out, spread isn't simply sugar for apply. Plan B is 
> meant to eliminate an inconvenient null check, but I'm a bit concerned that 
> the proposed behavior will simply hide actual bugs, as automatic coercions 
> often do. That said, automatic coercions are commonplace in ES already.

We really are trying not to add more implicit conversions. Honest!

Nevertheless, the argument based on matching Function.prototype.apply, plus the 
example John Lenz gave showing how plan A would require a fruitless 
null-or-undefined test:

if (x != null) {
  f(1,2,...x)
} else  {
  f(1,2)
}

sold me on plan B.

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

Reply via email to