just thinking out loud here, when you $H ur array object, is it hashing all the extra functions prototype put in Array.prototype like find(), findAll(), etc?
cuz if i do var hash1 = $H([1,2,3]) hash1.size() is not equal to hash1.length because length is an array property and size is a hash method On Oct 8, 7:16 am, Romain Dequidt <[email protected]> wrote: > 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 -~----------~----~----~----~------~----~------~--~---
