IE 6 has Array.prototype.push. That detection code is wrong... It
should be checking Array.prototype.push, not Array.push. Also,
MochiKit doesn't support IE 5.5, so that code should pretty much be
dead weight.

On 3/27/07, Bryce <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> Well after much banging of head against desk, tracing through code, I
> came to find that it was a problem whereby any false value wasn't
> being pushed onto an array.  This was due to a nasty piece of code in
> fValidate (for adding push to Arrays for IE):
>     if ( typeof Array.push == 'undefined' )
>     Array.prototype.push = function()
>     {
>         var arg, i = 0;
>         while( arg = arguments[i++] )
>         {
>                 this[this.length] = arg;
>         }
>         return this.length;
>     }
> So no problem in MochiKit.  Just some bad coding in another library.
>
> Cheers
> Bryce
>
> On Mar 28, 10:10 am, "Bryce" <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I am having a strange issue with partially applied functions on IE 6
> > (sp1) where any arguments that are supplied that are false, null, or 0
> > are dropped entirely from the partially applied function.  The
> > following test code shows what I mean:
> >         var test = function(a, b, c) {
> >             log(a + " " + b + " " + c);
> >         }
> >         partial(test, "a", "b")("c");
> >         partial(test, "a", false)("c");
> >         partial(test, false, "b")("c");
> >         partial(test, false, true)("c");
> > Gives an output of:
> >         INFO: a b c
> >         INFO: a c undefined
> >         INFO: b c undefined
> >         INFO: true c undefined
> > As you can see from this if b has false applied to it then when the
> > partially applied function is called the b argument takes the value of
> > "c" and the c argument is undefined.  This will give the same output
> > if the false values were replaced with 0, or null.
> >
> > I was wondering if anyone else had found this issue, whether there is
> > a work around, or strange as it seems to me maybe I am doing something
> > wrong.
> >
> > Cheers
> > Bryce
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to