Re: Node append

On Mon, 03 Oct 2011 19:01:19 +0200, Erik Arvidsson <arv@chromium.org>  
wrote:
> On Sun, Oct 2, 2011 at 13:10, Aryeh Gregor <ayg@aryeh.name> wrote:
>> 4) It allows the argument to behave like a real string argument, with
>> anything passed to it cast to a string, instead of throwing.
>> JavaScript is weakly typed, and authors are not used to distinguishing
>> much between 42 and "42".
>
> This one is important. JS devs are not used to do
> alert(value.toString()) nor innerText = value.toString() (Yes, they
> are unaware of textContent but that is a different problem).
>
> This point (and to be defined NodeList/Array support) prevents me from
> jumping up and down celebrating.

We can make that work. Web IDL introduced [AllowAny] for it, but maybe  
that should simply be the default. XMLHttpRequest.send() does that. It  
accepts everything, some objects behave special, but everything else will  
be stringified.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Monday, 3 October 2011 17:09:02 UTC