Explorar el Código

Adding ParseJson

Sebastien Ros hace 9 años
padre
commit
1cf3cca2df
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      Jint/Native/Json/JsonInstance.cs

+ 2 - 2
Jint/Native/Json/JsonInstance.cs

@@ -40,9 +40,9 @@ namespace Jint.Native.Json
         public JsValue Parse(JsValue thisObject, JsValue[] arguments)
         {
             var parser = new JavaScriptParser(TypeConverter.ToString(arguments[0]));
-            // TODO: Esprima, convert object to JsonInstance
 
-            return JsValue.Undefined;
+            var o = parser.ParseJson();
+            return Engine.GetValue(Engine.EvaluateExpression(o));
         }
 
         public JsValue Stringify(JsValue thisObject, JsValue[] arguments)