Fix #1184: Add missing argument to .apply()

The Javascript .apply() method takes two arguments: A context argument and an array of values. In CPWebScriptObject callWebScriptMethod:withArguments, only an array of arguments was passed to the .apply() method.

This fix inserts `this` as the first argument, and the array of arguments as the second. This has been converted to a pull request from the original issue (#1184)

The original issue also suggested a fix for handling namespaces, which are not incorporated in this patch.
This commit is contained in:
Andrew Hankinson committed 2013-02-26 21:37:57 -05:00
1 parent ae2ed8bf94
commit ee20038dce
1 file changed
+1 -1
+1 -1
View File
@@ -962,7 +962,7 @@ CPWebViewAppKitScrollMaxPollCount = 3;
{
try
{
return _window[methodName].apply(args);
return _window[methodName].apply(this, args);
}
catch (e)
{