PDA

View Full Version : is Function.apply() supported?


dannyy
07-10-2007, 11:48 AM
Hi,

Is the function Function.apply(context, arguments) really supported in OpenLaszlo 4.0 or above? The appendix of the developer guide says this function is not supported in OpenLaszlo. However, the LzUnit code, lzunit.lzx, does use this function:
<method name="run" args="theTestResult, theTestName">
....
inrsw = true;
rsw.apply(this, argument);
.....
</method>

I tried the following test code, and it worked as well. Both someOtherObject and testArgument were displayed correctly.
var f = function(a){
Debug.write("current context: ", this);
Debug.write("argument: ", a);
}

f.apply(someOtherObject, testArgument);

Thanks,

Danny

ptw
07-12-2007, 07:01 AM
That's a documentation bug. It was not supported in some previous version, but is now supported. Note that the restrictions in that table apply only to the SWF runtime. Please file a bug at http://jira.openlaszlo.org.

dannyy
07-12-2007, 10:49 AM
That's a documentation bug. It was not supported in some previous version, but is now supported. Note that the restrictions in that table apply only to the SWF runtime. Please file a bug at http://jira.openlaszlo.org.

Thanks, Ptw! I filed a bug the other day: http://www.openlaszlo.org/jira/browse/LPP-4273 .

ptw
10-30-2007, 11:08 AM
http://www.openlaszlo.org/jira/browse/LPP-4338