From 43afba45f1acb47c50477e58242e05ff720b9899 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 18 Jul 2005 18:03:08 +0000 Subject: [PATCH] basically reverted back - left the try catch git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@403 9efc2488-bf62-4759-914b-345cdb29e865 --- src/javascript/JSON.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/javascript/JSON.js b/src/javascript/JSON.js index 7511f32..6994cfc 100644 --- a/src/javascript/JSON.js +++ b/src/javascript/JSON.js @@ -41,10 +41,20 @@ function object2Array(obj) { return arr; } + function js2JSON(arg) { + try { + return _js2JSON(arg); + } catch(E) { + //alert(E + "EX"); + if(arg && arg.toString) return arg.toString(); + return arg; + } +} + +function _js2JSON(arg) { var i, o, u, v; - try { switch (typeof arg) { case 'object': @@ -127,8 +137,5 @@ function js2JSON(arg) { default: return '"' + String(arg).replace(/(["\\])/g, '\\$1') + '"'; } - } catch(E) { - if(arg && arg.toString) return arg.toString(); - return arg; - } + } -- 2.11.0