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

Klemens Mantzos klemens.mantzos at knallgrau.at
Fri Mar 9 16:42:28 CET 2007


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


More information about the Helma-user mailing list