Subj : JS_EvaluateScript strabge behaivor To : netscape.public.mozilla.jseng From : prohto@yahoo.com (Carlos F.) Date : Wed Feb 04 2004 06:03 pm Hi all, After I solved my problems with the GC, thanks to Brendan, now I'm having some trouble with the function JS_EvaluateScript. In some cases it return a invalid value at rval. The following is the code I'm running to evaluate and to get the returned string: rts = JS_EvaluateScript( ctx, obj, Expr, Expr_len, "any", 0, &rval ); str = JS_ValueToString( ctx, rval); s = JS_GetStringBytes( str ); When Expr is "'This is the value of num '+num", I always get the right value. But if the expression is just "num" ( to get his value as string ), there are several times that I get a wrong value. ( num is defined ). When I evaluate the two expresion, one after the other, in the first one I get the correct value, but on the second I get an old value. I hope somebody could give some ideas where I'm making the mistake. Best regards Carlos F. .