Fix bug that evaluator.thread was not set when parsing scripts.

This commit is contained in:
hns 2003-01-30 16:39:02 +00:00
parent a4e36e6ae3
commit ab14bbb898

View file

@ -123,6 +123,8 @@ public class FesiEngine implements ScriptingEngine {
* necessary to bootstrap the rest is parsed. * necessary to bootstrap the rest is parsed.
*/ */
private void initialize () { private void initialize () {
// set the thread filed in the FESI evaluator
evaluator.thread = Thread.currentThread ();
Collection protos = app.getPrototypes(); Collection protos = app.getPrototypes();
for (Iterator i=protos.iterator(); i.hasNext(); ) { for (Iterator i=protos.iterator(); i.hasNext(); ) {
Prototype proto = (Prototype) i.next (); Prototype proto = (Prototype) i.next ();
@ -132,6 +134,7 @@ public class FesiEngine implements ScriptingEngine {
// we always need it and there's no chance to trigger // we always need it and there's no chance to trigger
// creation on demand. // creation on demand.
getPrototype ("global"); getPrototype ("global");
evaluator.thread = null;
} }
/** /**
@ -268,6 +271,8 @@ public class FesiEngine implements ScriptingEngine {
* engine know it should update its prototype information. * engine know it should update its prototype information.
*/ */
public void updatePrototypes () { public void updatePrototypes () {
// set the thread filed in the FESI evaluator
evaluator.thread = Thread.currentThread ();
Collection protos = app.getPrototypes(); Collection protos = app.getPrototypes();
for (Iterator i=protos.iterator(); i.hasNext(); ) { for (Iterator i=protos.iterator(); i.hasNext(); ) {
Prototype proto = (Prototype) i.next (); Prototype proto = (Prototype) i.next ();