Re: new DOM4 insertions methods and return values

On 1/16/13 5:32 AM, Jake Verbaten wrote:
> The only reason to pass the document fragment back is to match what
> elem.appendChild(documentFragment) does currently and to have the result
> be either null or a single type. In reality it might make more sense to
> return the first node in nodes or the nodes as an array.

Note that having a non-void return value makes the method slower. 
Sometimes significantly slower (especially if the return values are 
polymorphic like you just describe)...

So there had better be very good use cases for this sort of thing. ;)

-Boris

Received on Wednesday, 16 January 2013 14:58:30 UTC