You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by do...@apache.org on 2008/03/07 13:33:32 UTC

svn commit: r634641 - /incubator/shindig/trunk/features/core/json.js

Author: doll
Date: Fri Mar  7 04:33:31 2008
New Revision: 634641

URL: http://svn.apache.org/viewvc?rev=634641&view=rev
Log:
Changed gadgets.json.parse to match the spec. If the json can't be parsed it returns false (instead of throwing an exception)


Modified:
    incubator/shindig/trunk/features/core/json.js

Modified: incubator/shindig/trunk/features/core/json.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/core/json.js?rev=634641&r1=634640&r2=634641&view=diff
==============================================================================
--- incubator/shindig/trunk/features/core/json.js (original)
+++ incubator/shindig/trunk/features/core/json.js Fri Mar  7 04:33:31 2008
@@ -158,9 +158,9 @@
           replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
         return eval('(' + text + ')');
       }
-      // If the text is not JSON parseable, then a SyntaxError is thrown.
+      // If the text is not JSON parseable, then return false.
 
-      throw new Error('parseJSON');
+      return false;
     }
   };
 }();