Author: rombert
Date: Wed Aug  9 15:32:52 2017
New Revision: 1804546

URL: http://svn.apache.org/viewvc?rev=1804546&view=rev
Log:
SLING-7041 - Use JSON parsing in Sling.evalString

Modified:
    sling/trunk/bundles/servlets/post/src/main/resources/system/sling.js

Modified: sling/trunk/bundles/servlets/post/src/main/resources/system/sling.js
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/resources/system/sling.js?rev=1804546&r1=1804545&r2=1804546&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/post/src/main/resources/system/sling.js 
(original)
+++ sling/trunk/bundles/servlets/post/src/main/resources/system/sling.js Wed 
Aug  9 15:32:52 2017
@@ -194,15 +194,7 @@ var Sling = null;
     
     /** eval str, accepting various object delimiters */
     Sling.evalString = function(str) {
-        var obj = null;
-        if(str.indexOf('[')==0) {
-            eval("obj="+str);
-        } else if(str.indexOf('{')==0) {
-            eval("obj="+str);
-        } else {
-            eval("obj={"+str+"}");
-        }
-        return obj;
+       return JSON.parse(str);
     }
      
     /** Get "session info" from repository. Mainly answers the question: "Who 
am I"


Reply via email to