[Helma-user] helmaLib - Object.clone() - bug?

Klemens Mantzos klemens.mantzos at gmail.com
Fri Mar 9 18:37:07 CET 2007


so...

what is the diff between this
http://adele.helma.org/source/viewcvs.cgi/helmaLib/

and that!?
http://adele.helma.org/source/viewcvs.cgi/modules/helma/

i'm kind of confused.


On 3/9/07, robert.gaggl at orf.at <robert.gaggl at orf.at> wrote:
> hi klemens,
>
> looks like you have an old version of helma.Html, because i fixed this
> bug two weeks ago (see
> http://adele.helma.org/source/viewcvs.cgi/modules/helma/Html.js.diff?r1=
> 1.5&r2=1.6)
>
> using param.clone() unfortunately isn't possible because the param
> object might be one received from a macro, and these aren't JS objects
> but a mapwrapper ones, which in turn don't inherit the
> Object.prototype.clone() method. that's why i switched to calling
> reduce(), which clones the object into a plain JS object.
>
> so updating helma.Html to the current CVS version should solve your
> problem.
>
> robert
>
>
> > -----Original Message-----
> > From: helma-user-bounces at helma.org
> > [mailto:helma-user-bounces at helma.org] On Behalf Of Klemens Mantzos
> > Sent: Friday, March 09, 2007 4:42 PM
> > To: Helma User Mailing List
> > Subject: [Helma-user] helmaLib - Object.clone() - bug?
> >
> > Hi,
> >
> > this bug is in helma 1.6 only (im using java 1.6.0_01-ea)...
> >
> > the helmaLib Html.input() tries to clone the param attribute.
> > it uses the Object.clone() method (in a wrong way, i think):
> >
> > helma.Html.js #229
> >        var attr = Object.clone(param);
> >
> > so it doesn't clone param.
> >
> > a short example:
> > var foo = {jo: "jo"};
> > var bar = Object.clone(foo);
> > res.debug(uneval(foo) + " - " + uneval(bar));
> >
> > result:
> > ({jo:"jo", prototype:{}}) - ({jo:"jo", prototype:{}})
> >
> > when i use foo.clone() everything works fine.
> >
> > so the solution is maybe:
> > helma.Html.js #229
> >        var attr = param.clone();
> >
> > thx
> > --
> > klemens mantzos
> > web developer | vienna - http://knallgrau.at -
> > http://twoday.net - http://blogr.com
> > _______________________________________________
> > Helma-user mailing list
> > Helma-user at helma.org
> > http://helma.org/mailman/listinfo/helma-user
> >
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://helma.org/mailman/listinfo/helma-user
>


-- 
klemens mantzos
web developer | vienna - http://knallgrau.at - http://twoday.net -
http://blogr.com


More information about the Helma-user mailing list