Michael Peters wrote:
[EMAIL PROTECTED] wrote:
> Hello,
>
> I've noticed that when you put a ',' at the end of the last effect, IE
> doesn't work.
It doesn't work because it's not really correct.
Not correct in what way? It is legal ECMAScript syntax, however it is
interpreted incorrectly by IE which will add an extra element to the
array. Therefore it may be "not correct" because Effect.Parallel
expects all elements in the array to have been assigned a value.
Firefox allows it
Because Firefox follows the ECMAScript specification. A trailing comma
in an Array literal should not create an extra element, however in IE
it will create an extra element with an unassigned value.
e.g.:
var x = [,,,];
alert(x.length); // shows 3 in Firefox, 4 in IE.
Firefox is correct, IE is wrong.
which is
frankly a pain because you won't catch the mistake unless you fire up IE.
Should Firefox use a non-compliant implementation and mimic IE's bugs
just to save developers having to properly test their code? You could
equally criticise the Effect class for not checking the values passed
to it.
I
admit that it's a pain since other languages allow the extra comma (Perl) and
you just get used to it.
In this regard, ECMAScript is consistent with those "other languages" -
it is IE's flawed implementation of the specification that is the
difference.
--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---