I agree with Lars (and Mark) on this. It would be best if access to 'this'
would throw. Throwing in the actual call to the function seems a bit harsh
since the statement that refers to 'this' might never be reached. Making
the access throw would allow people to at least catch the error and fall
-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
On Sun, Mar 30, 2008 at 6:54 AM, Lars Hansen [EMAIL PROTECTED] wrote:
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
On Mar 22, 2008, at 10:18 PM, Mike Shaver wrote:
On Sat, Mar 22, 2008 at 4:32 PM, Dean Edwards [EMAIL PROTECTED]
wrote:
Dean Edwards wrote:
I think that the problem is that Array generics were added later.
From bugzilla:
Array.generic(t, ...) is *intended* to be equivalent to
On Sun, Mar 23, 2008 at 2:44 AM, Dean Edwards [EMAIL PROTECTED] wrote:
I'd prefer Array.forEach(null) to do nothing, just like for (var i in
null) does nothing. I'm prepared to be convinced otherwise. :-)
forEach isn't like enumeration, though, it's like the more common
Array pattern of
for
Mike Shaver wrote:
On Sun, Mar 23, 2008 at 2:44 AM, Dean Edwards [EMAIL PROTECTED] wrote:
I'd prefer Array.forEach(null) to do nothing, just like for (var i in
null) does nothing. I'm prepared to be convinced otherwise. :-)
forEach isn't like enumeration, though, it's like the more common
On Mon, Mar 24, 2008 at 10:31 AM, Dean Edwards [EMAIL PROTECTED] wrote:
It seems we have three choices for Array.forEach(null)
1) Do nothing
2) Throw an exception
3) Use the current object and iterate that
By current object do you mean the global object?
I prefer the first one,
On Sat, Mar 22, 2008 at 1:42 PM, Garrett Smith [EMAIL PROTECTED] wrote:
Array generic methods will be safer if they check their args and throw
an error - InvalidArgumentError, TypeError, UnlikeError - (whatever).
Invalid: (this will crash Firefox with endless loop):-
Array.forEach( {
-- Forwarded message --
From: Garrett Smith [EMAIL PROTECTED]
Date: Mon, Mar 24, 2008 at 11:27 AM
Subject: Re: Array Generics and null
To: Dean Edwards [EMAIL PROTECTED]
On Mon, Mar 24, 2008 at 10:31 AM, Dean Edwards [EMAIL PROTECTED] wrote:
Mike Shaver wrote:
On Sun, Mar
I suspected that. It is the problem with Google Mail, which exhibited
a bug in Firefox.
Use case:
0) hit reply
1) click 'send'
2) hit 'stop'
3) click 'reply to all' and watch the To: field change.
4) watch Gmail send a mail *instantly*. Gmail displays headers in the
'show details' for all
Hello all -
I wanted to bring up one point for discussion. Based upon Mozilla's
implementation of Array generics (and what will, presumably, be standardized
here) you can see that typically doing:
Array.forEach(null, function(){alert(arguments);});
produces no alerts. However, performing it
On Sat, Mar 22, 2008 at 9:01 AM, John Resig [EMAIL PROTECTED] wrote:
Hello all -
It seems like there could be a couple solutions:
Objects that are not capable of running in an Array-generic should not
be attempted to run.
Would it make sense to use - like - for all the Array generics? Is
On Sat, Mar 22, 2008 at 4:32 PM, Dean Edwards [EMAIL PROTECTED] wrote:
Dean Edwards wrote:
I think that the problem is that Array generics were added later.
From bugzilla:
Array.generic(t, ...) is *intended* to be equivalent to
Array.prototype.generic.call(t, ...).
13 matches
Mail list logo