You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jo...@apache.org on 2006/12/17 21:57:00 UTC

svn commit: r488047 - in /cocoon/branches/BRANCH_2_1_X: src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java status.xml

Author: joerg
Date: Sun Dec 17 12:56:59 2006
New Revision: 488047

URL: http://svn.apache.org/viewvc?view=rev&rev=488047
Log:
COCOON-1811: Allow dynamic loading of JavaScript objects even when scope is locked.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java?view=diff&rev=488047&r1=488046&r2=488047
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java Sun Dec 17 12:56:59 2006
@@ -51,7 +51,6 @@
 import org.mozilla.javascript.JavaScriptException;
 import org.mozilla.javascript.NativeJavaClass;
 import org.mozilla.javascript.NativeJavaPackage;
-import org.mozilla.javascript.PropertyException;
 import org.mozilla.javascript.Script;
 import org.mozilla.javascript.ScriptRuntime;
 import org.mozilla.javascript.Scriptable;
@@ -415,13 +414,9 @@
             final Context context = Context.getCurrentContext();
 
             final String[] names = { "importClass" };
-            try {
-                defineFunctionProperties(names,
-                                         ThreadScope.class,
-                                         ScriptableObject.DONTENUM);
-            } catch (PropertyException e) {
-                throw new Error();  // should never happen
-            }
+            defineFunctionProperties(names,
+                                     ThreadScope.class,
+                                     ScriptableObject.DONTENUM);
 
             setPrototype(scope);
 
@@ -456,7 +451,7 @@
         public void put(String name, Scriptable start, Object value) {
             //Allow setting values to existing variables, or if this is a
             //java class (used by importClass & importPackage)
-            if (this.locked && !has(name, start) && !(value instanceof NativeJavaClass)) {
+            if (this.locked && !has(name, start) && !(value instanceof NativeJavaClass) && !(value instanceof Function)) {
                 // Need to wrap into a runtime exception as Scriptable.put has no throws clause...
                 throw new WrappedException (new JavaScriptException("Implicit declaration of global variable '" + name +
                   "' forbidden. Please ensure all variables are explicitely declared with the 'var' keyword"));

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/status.xml?view=diff&rev=488047&r1=488046&r2=488047
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Sun Dec 17 12:56:59 2006
@@ -184,35 +184,38 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.10" date="TBD">
-   <action context="build">
-    Release 2.1.10 is the last one to support JDK1.3.
-    Future releases will require JDK1.4 or later.
-    The Cocoon developer community feels that the effort to maintain compatibility
-    to an outdated Java version is no longer justified.
-   </action>
-   <action dev="CZ" type="fix" fixes-bug="COCOON-1916" due-to="Rob Berens">
-    CForms: Always set viewData for flow script functions (if it's not available set it to null).
-   </action>
-   <action dev="CZ" type="fix" fixes-bug="COCOON-1969" due-to="Jeroen Reijn">
+    <action context="build">
+      Release 2.1.10 is the last one to support JDK1.3.
+      Future releases will require JDK1.4 or later.
+      The Cocoon developer community feels that the effort to maintain compatibility
+      to an outdated Java version is no longer justified.
+    </action>
+    <action dev="JH" type="fix" fixes-bug="COCOON-1811" due-to="Rob Berens">
+      Core: Allow dynamic loading of JavaScript objects even when scope is locked.
+    </action>
+    <action dev="CZ" type="fix" fixes-bug="COCOON-1916" due-to="Rob Berens">
+      CForms: Always set viewData for flow script functions (if it's not available set it to null).
+    </action>
+    <action dev="CZ" type="fix" fixes-bug="COCOON-1969" due-to="Jeroen Reijn">
       Javaflow OJB Sample: Fix "No method 'showEmployee' found".
-   </action>
-   <action dev="CZ" type="fix" fixes-bug="COCOON-1970" due-to="Jeroen Reijn">
+    </action>
+    <action dev="CZ" type="fix" fixes-bug="COCOON-1970" due-to="Jeroen Reijn">
       The JavaFlow OJB sample overwrote the first entry on insert instead of adding a new entry.
       This has been fixed.
-   </action>
-   <action dev="CZ" type="remove">
-     Core: Removed the buggy WildhardHelper. Use the new improved WildcardMatcherHelper.
-   </action>
-   <action dev="CZ" type="add">
-     Profiler block: Add statistics component.
-   </action>
-   <action dev="CZ" type="add">
-     Databases block: Add support for iBatis to use configured Excalibur data sources in iBatis.
-   </action>
-   <action dev="AS" type="fix" fixes-bug="COCOON-1965" due-to="Jeroen Reijn">
+    </action>
+    <action dev="CZ" type="remove">
+      Core: Removed the buggy WildhardHelper. Use the new improved WildcardMatcherHelper.
+    </action>
+    <action dev="CZ" type="add">
+      Profiler block: Add statistics component.
+    </action>
+    <action dev="CZ" type="add">
+      Databases block: Add support for iBatis to use configured Excalibur data sources in iBatis.
+    </action>
+    <action dev="AS" type="fix" fixes-bug="COCOON-1965" due-to="Jeroen Reijn">
       CForms: The filterfield widget was not defined for the forms manager.
-   </action>
-   <action dev="AG" type="fix" fixes-bug="COCOON-1962" due-to="Carlos Chávez" due-to-email="cchavez@agssa.net">
+    </action>
+    <action dev="AG" type="fix" fixes-bug="COCOON-1962" due-to="Carlos Chávez" due-to-email="cchavez@agssa.net">
       CForms: Numeric based suggestion list should initialzate to the corresponding suggested text.
     </action>
     <action dev="BRD" type="update">
@@ -235,7 +238,7 @@
         <li>Sitemaps can now call flowscripts written in a static namespaced style.</li>
         <li>Added JSON Serialization utilities for flowscript.</li>
         <li>You can now get i18n translations from Stings in flowscript.</li>
-        </ul>
+      </ul>
     </action>
     <action dev="VG" type="add">
       Core: Add ability to pre-load i18n catalogues in I18nTransformer.