From ab349a1c3cc4e881caae941c2f6a5381a3e0a7e6 Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 26 Nov 2002 13:24:17 +0000 Subject: [PATCH] Always set evaluator.thread field in invoke(). Otherwise a TimeoutException will be thrown if invoke() is called before the execution context is entered, which is the case when resolving request paths via scripted getChildElement() functions. --- src/helma/scripting/fesi/FesiEngine.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/helma/scripting/fesi/FesiEngine.java b/src/helma/scripting/fesi/FesiEngine.java index 8a1fd32d..7782fcf4 100644 --- a/src/helma/scripting/fesi/FesiEngine.java +++ b/src/helma/scripting/fesi/FesiEngine.java @@ -382,6 +382,10 @@ public final class FesiEngine implements ScriptingEngine { eso = global; else eso = getElementWrapper (thisObject); + // Workaround to let the evaluator know about the current thread + // even if enterContext() has not been called yet. Otherwise, + // a TimeoutException would be thrown. + evaluator.thread = Thread.currentThread (); try { ESValue[] esv = args == null ? new ESValue[0] : new ESValue[args.length]; for (int i=0; i