> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Brendan Eich
> Sent: 29. mars 2008 11:05
> To: Mike Shaver; es4-discuss
> Cc: Dean Edwards
> Subject: Re: Array Generics and null
> We would rather:
>
> function topLevel(a,b,c) {
> print(this, a, b, c);
> }
> topLevel(1,2,3);
>
> print "undefined 1 2 3" than "[object global] 1 2 3".
>
> This is incompatible, so it would happen only in some opt-in
> version, or opt-in version + strict pragma enabled.
>
> The issues are whether undefined or null should be the
> default (undefined has won, AFAICT),
The third option on the table is that the reference to 'this'
inside the body of topLevel simply throws an error. This has
both less and more utility: the function can't discover if it
was called as a function or as a method; but functions that
simply assume they were called as methods will fail earlier.
--lars
_______________________________________________
Es4-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es4-discuss