cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [2/2] cordova-wp8 git commit: Catch possible errors with JSON.stringify()
Date Thu, 29 Jan 2015 19:46:09 GMT
Catch possible errors with JSON.stringify()


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

Branch: refs/heads/master
Commit: 06591601f63dd495ebfb1a8bb173b8c1452e2e1d
Parents: a9fd4e4
Author: Oliver Salzburg <oliver.salzburg@gmail.com>
Authored: Thu Jan 29 09:38:46 2015 +0100
Committer: Oliver Salzburg <oliver.salzburg@gmail.com>
Committed: Thu Jan 29 09:38:46 2015 +0100

----------------------------------------------------------------------
 template/cordovalib/ConsoleHelper.cs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/06591601/template/cordovalib/ConsoleHelper.cs
----------------------------------------------------------------------
diff --git a/template/cordovalib/ConsoleHelper.cs b/template/cordovalib/ConsoleHelper.cs
index 2ab81e9..94c4212 100644
--- a/template/cordovalib/ConsoleHelper.cs
+++ b/template/cordovalib/ConsoleHelper.cs
@@ -63,7 +63,11 @@ namespace WPCordovaClassLib.CordovaLib
                             return argument.toString();
                         }
                         // Convert complex arguments to JSON.
-                        return JSON.stringify( argument );
+                        try {
+                            return JSON.stringify( argument );
+                        } catch( ignored ) {
+                            return argument.toString();
+                        }
                     } )
                         .join( ',' ); 
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message