|
@@ -105,8 +105,9 @@ namespace Jint.Native.Json
|
|
|
return Str("", wrapper);
|
|
|
}
|
|
|
|
|
|
- private string Str(string key, ObjectInstance holder)
|
|
|
+ private JsValue Str(string key, ObjectInstance holder)
|
|
|
{
|
|
|
+
|
|
|
var value = holder.Get(key);
|
|
|
if (value.IsObject())
|
|
|
{
|
|
@@ -124,7 +125,7 @@ namespace Jint.Native.Json
|
|
|
if (_replacerFunction != Undefined.Instance)
|
|
|
{
|
|
|
var replacerFunctionCallable = (ICallable)_replacerFunction.AsObject();
|
|
|
- value = replacerFunctionCallable.Call(holder, Arguments.From(key));
|
|
|
+ value = replacerFunctionCallable.Call(holder, Arguments.From(key, value)); // 15.12.3-11-12 added missing value parameter
|
|
|
}
|
|
|
|
|
|
|
|
@@ -142,8 +143,16 @@ namespace Jint.Native.Json
|
|
|
case "Boolean":
|
|
|
value = TypeConverter.ToPrimitive(value);
|
|
|
break;
|
|
|
+ case "Array": // 15.12.3-11-12 added missing serialization of array
|
|
|
+ value = SerializeArray(value.As<ArrayInstance>());
|
|
|
+ return value;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (value == Undefined.Instance) {
|
|
|
+ return Undefined.Instance; // 15.12.3-11-10
|
|
|
+ }
|
|
|
|
|
|
if (value == Null.Instance)
|
|
|
{
|
|
@@ -248,7 +257,7 @@ namespace Jint.Native.Json
|
|
|
for (int i = 0; i < len; i++)
|
|
|
{
|
|
|
var strP = Str(TypeConverter.ToString(i), value);
|
|
|
- partial.Add(strP);
|
|
|
+ partial.Add(strP.AsString()); // 15.12.3-11-12
|
|
|
}
|
|
|
if (partial.Count == 0)
|
|
|
{
|