Good news. I have managed to get evaluateString and compileFunction
working. I have not been able to get compileString to produce a script
which can be executed later.

Please excuse my ignorance, but when:

1.  An object is defined at the top of a scope, and
2.  Is then instantiated using the "new" keyword in a function further
down in the scope, and
3.  Assigned to a local variable within that function..

Where is the instance attached? Will it be garbage collected? It
appears that the instantiated object, even though assigned to a local
variable within the function, does not have access to the local scope
of the function. In other words, my guess is that the instance is
actually instantiated within the global scope, and then referenced by
the local variable.

I'm concerned that something like this would be unable to be garbage
collected. These instantiations are made on an incoming HTTP request
basis and hence my concern.

If the above is the case, would it be best to define these objects
within a compiled function that is then called by my java web server,
with the assumption that this would cause the instances to be attached
to the scope of the function, and hence be available for collection
after the function has run its course?
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to