cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: svn commit: rev 55957 - in cocoon/branches/BRANCH_2_1_X: . src/java/org/apache/cocoon/components/flow/javascript/fom
Date Fri, 29 Oct 2004 10:38:54 GMT
Vadim Gritsenko wrote:

> sylvain@apache.org wrote:
>
>>
>> @@ -687,6 +703,7 @@
>>                      if (fun == Scriptable.NOT_FOUND) {
>>                          throw new 
>> ResourceNotFoundException("Function \"javascript:" + funName + "()\" 
>> not found");
>>                      }
>> +                    thrScope.setLock(true);
>>                      ScriptRuntime.call(context, fun, thrScope, 
>> funArgs, thrScope);
>>                  } catch (JavaScriptException ex) {
>>                      EvaluatorException ee = Context.reportRuntimeError(
>> @@ -710,6 +727,7 @@
>>                      throw new 
>> CascadingRuntimeException(ee.getMessage(), ee);
>>                  }
>>              } finally {
>> +                thrScope.setLock(false);
>>                  setSessionScope(thrScope);
>>                  if (cocoon != null) {
>>                      cocoon.popCallContext();
>
>
> Is there a reason why you need to "un-lock" it?


Yes: the scope must be unlocked whenever a script is loaded, in order 
for the global variable declarations to be possible. Without unlock, no 
global variables, which would be pretty much annoying :-)

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message