[ http://issues.apache.org/jira/browse/COCOON-1811?page=all ]
Jörg Heinicke closed COCOON-1811. --------------------------------- Fix Version/s: 2.2-dev (Current SVN) 2.1.10-dev (current SVN) Resolution: Fixed Fixed with that patch, but ... if we actually want to prevent variables to be put into global scope, isn't there a possibility to check for it directly instead of "!(value instanceof NativeJavaClass) && !(value instanceof Function)"? > [PATCH] Flow Script: Allow dynamic loading of JavaScript objects even when > scope is locked > ------------------------------------------------------------------------------------------ > > Key: COCOON-1811 > URL: http://issues.apache.org/jira/browse/COCOON-1811 > Project: Cocoon > Issue Type: Improvement > Components: Blocks: Forms > Affects Versions: 2.2-dev (Current SVN), 2.1.9 > Reporter: Rob Berens > Assigned To: Jörg Heinicke > Priority: Minor > Fix For: 2.2-dev (Current SVN), 2.1.10-dev (current SVN) > > Attachments: 20060409-cocoon-forms-1811 > > > Currently it is not possible to add variables to the scope of a > FOM_JavaScriptInterpreter, unless the scope is not locked yet or when still > in the main loading process or when loading native java classes. Therefore it > is not possible to dynamically load JavaScript classes like the one below:. > ------------------------------- > function myObject() { // at this point the current > implementation throws the exception > // constructor for myObject > } > myObject.prototype.myMethod = function() { > // implementation of myMethod > } > ------------------------------- > from within a script fragment like this one: > ------------------------------- > function loadScript() { > var scriptURI = "determineScriptURIFromRequest"; > cocoon.load(scriptURI); > } > ------------------------------- > The attached patch solves this by allowing also objects of the type > org.mozilla.javascript.Function to be loaded into a locked scope. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira