From: phasefx Date: Thu, 24 Feb 2005 21:26:51 +0000 (+0000) Subject: casting X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=86aef5f006204dc27c5b2f858f33be89e5c28e15;p=working%2FOpenSRF.git casting git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@114 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/javascript/JSON.js b/src/javascript/JSON.js index 3cee963..9145267 100644 --- a/src/javascript/JSON.js +++ b/src/javascript/JSON.js @@ -22,8 +22,8 @@ function Cast (obj, class_constructor) { } function JSON2js (json) { - json = json.replace( /\/\*--\s*S\w*?\s*?\s+\w+\s*--\*\//g, 'Cast('); - json = json.replace( /\/\*--\s*E\w*?\s*?\s+(\w+)\s*--\*\//g, ', "$1")'); + json = String(json).replace( /\/\*--\s*S\w*?\s*?\s+\w+\s*--\*\//g, 'Cast('); + json = String(json).replace( /\/\*--\s*E\w*?\s*?\s+(\w+)\s*--\*\//g, ', "$1")'); var obj; if (json != '') { eval( 'obj = ' + json );