cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [2/2] js commit: Update exec.js
Date Tue, 11 Feb 2014 16:06:03 GMT
Update exec.js

The spec implies that the last argument of cordova.exec() should be optional.  However, if
it is omitted, iOS emits a cryptic NSInvalidArgumentException.  This can be avoided if actionArgs
defaults to an empty array.


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/d87d7d76
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/d87d7d76
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/d87d7d76

Branch: refs/heads/master
Commit: d87d7d76ce5824021cd89345c0e9b791bc5daa28
Parents: e3cd6cd
Author: vote539 <vote539@gmail.com>
Authored: Sat Jan 4 03:26:46 2014 -0700
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Feb 11 11:05:58 2014 -0500

----------------------------------------------------------------------
 src/ios/exec.js | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/d87d7d76/src/ios/exec.js
----------------------------------------------------------------------
diff --git a/src/ios/exec.js b/src/ios/exec.js
index 58ca079..68b4b03 100644
--- a/src/ios/exec.js
+++ b/src/ios/exec.js
@@ -166,6 +166,9 @@ function iOSExec() {
             return;
         } catch (e) {}
     }
+    
+    // If actionArgs is not provided, default to an empty array
+    actionArgs = actionArgs || [];
 
     // Register the callbacks and add the callbackId to the positional
     // arguments if given.


Mime
View raw message