You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2014/01/08 00:13:42 UTC

mac commit: isArray and isDictionary were not working

Updated Branches:
  refs/heads/master b100f97ec -> 339bbeb51


isArray and isDictionary were not working

Therefore making it impossible to pass in arrays or objects from Javascript.
`callWebScriptMethod` can only call immediate properties on an object.


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

Branch: refs/heads/master
Commit: 339bbeb51fc3ea0ac33a9c93bec78b3a907b4a37
Parents: b100f97
Author: Adam George <gi...@adamgeorge.com>
Authored: Sat Jul 20 11:45:57 2013 +1000
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Tue Jan 7 15:13:32 2014 -0800

----------------------------------------------------------------------
 CordovaFramework/CordovaFramework/Classes/CDVBridge.m | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/339bbeb5/CordovaFramework/CordovaFramework/Classes/CDVBridge.m
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/CDVBridge.m b/CordovaFramework/CordovaFramework/Classes/CDVBridge.m
index fade163..e34f8ed 100644
--- a/CordovaFramework/CordovaFramework/Classes/CDVBridge.m
+++ b/CordovaFramework/CordovaFramework/Classes/CDVBridge.m
@@ -30,7 +30,8 @@
 - (BOOL) isArray:(id)item
 {
     id win = [self.webView windowScriptObject];
-    NSNumber* result = [win callWebScriptMethod:@"CordovaBridgeUtil.isArray" withArguments:[NSArray arrayWithObject:item]];
+    WebScriptObject* bridgeUtil = [win evaluateWebScript:@"CordovaBridgeUtil"];
+    NSNumber* result = [bridgeUtil callWebScriptMethod:@"isArray" withArguments:[NSArray arrayWithObject:item]];
 
     return [result boolValue];
 }
@@ -38,7 +39,8 @@
 - (BOOL) isDictionary:(id)item
 {
     id win = [self.webView windowScriptObject];
-    NSNumber* result = [win callWebScriptMethod:@"CordovaBridgeUtil.isObject" withArguments:[NSArray arrayWithObject:item]];
+    WebScriptObject* bridgeUtil = [win evaluateWebScript:@"CordovaBridgeUtil"];
+    NSNumber* result = [bridgeUtil callWebScriptMethod:@"isObject" withArguments:[NSArray arrayWithObject:item]];
     return [result boolValue];
 }