Would that be a relevant wrapper?
function hash_wrapper(var)
{
if (var && (var.constructor == Array) && (var.length == 0)) {
return;
}
return $H(var);
}
On 8 oct, 15:55, Romain Dequidt <[email protected]> wrote:
> My problem (http://groups.google.fr/group/prototype-scriptaculous/t/
> 313d3a8b674d5b28?hl=fr) comes from that issue.
> The "errors" object is actually a empty array when there is no error.
> But when I try to create my hash by doing:
> $H(transport.responseJSON.errors)
> the result is a weird hash (size() == 38!!!!!)
>
> yoshi, how do you fixed it? what kind of test should I do before the
> hash creation?
>
> On 8 oct, 00:34, yoshi <[email protected]> wrote:
>
> > i m trying to upgrade prototype 1.5.1 to 1.6.1, then realized that the
> > $H changed, and not compatible with '[]' anymore.
>
> > the code base is huge, and $H is used very often. i m wondering if
> > theres a smarter way then
> > 1) writing my own wrapper around $H, so it works with old code, or
> > 2) surgically update all variables using $H
>
> > thanks in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---