Subj : Re: JS_EvaluateScript strabge behaivor To : "Carlos F." From : Brendan Eich Date : Thu Feb 05 2004 01:02 pm Carlos F. wrote: >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 ); > > Check for errors, if you aren't. >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 ). > > I'm sorry, you really have to give exact inputs and outputs to get useful help. >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. > > /be >Best regards > > >Carlos F. > > .