2009-01-30:
[21:54] <jdzp> hey, any rhino experts on? i have a question about app.data[21:55] <jdzp> specifically, how does helma prevent objects put into app.data from keeping pointers around to random scopes?[21:55] <jdzp> (in turn preventing those scopes from being GC'd?)[22:54] <hannesw> jdzp: there's no way to prevent this[22:54] <hannesw> you just need to be careful here[22:54] <jdzp> interesting. so does that mean that scopes aren't necessarily collected when code changes, for example?[22:55] <hannesw> possibly, yes[22:55] <jdzp> i'm looking at the rhino source and it looks like when rhino wraps a java object it keeps around a scope pointer[22:56] <jdzp> so i guess putting java objects in app.data (unless i create them myself with "new") may keep the scope around, then.[22:57] <hannesw> I'm not sure, it's possible[22:58] <hannesw> if you call a java method, the object will be unwrapped.[22:58] <hannesw> not sure what happens whan you assign it to app.data.[22:58] <jdzp> i'd guess that the wrapped object it kept around, though i'm not sure either.[23:00] <hannesw> actually, the object should be unwrapped in app.data[23:00] <hannesw> it's a HopObject[23:01] <hannesw> but I haven't tested it, just looked at the code[23:01] <jdzp> app.data is a HopObject[23:01] <hannesw> yes, a transient one[23:02] <jdzp> and puts/sets on hopobjects unwrap java objects? (sorry, could you point me to a line of code? :D - if it's easily findable)[23:03] <jdzp> oh, i see it.[23:05] <hannesw> here: http://dev.helma.org/trac/helma/browser/helma/helma/trunk/src/helma/scripting/rhino/HopObject.java#L772[23:06] <jdzp> thanks.[23:07] <hannesw> you're welcome[23:08] <jdzp> it looks like this code doesn't convert plain javascript objects to HopObjects (or other wrappers) though - if I do "var a = {}" do I get back one of those automatically?[23:14] <jdzp> (hannesw ping)[23:15] <hannesw> no, plain javascript objects are never converted to HopObjects.[23:15] <jdzp> ah, ok[23:15] <jdzp> so native java objects are unwrapped if put into app.data directly, but if they're properties of normal javascript objects that are then put into app.data, they won't get unwrapped?[23:22] <hannesw> right[23:22] <jdzp> ok, hey, thanks for all your help![23:23] <hannesw> no problem, good night ;-)[23:23] <jdzp> heh, i've got half a day left here, but yes - good night!
In the channel now:
Logs by date: