|
|
@ -14,6 +14,7 @@ using System.Diagnostics; |
|
|
|
using System.Collections; |
|
|
|
using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Text; |
|
|
|
using System.Text; |
|
|
|
|
|
|
|
using MoonSharp.Interpreter.Diagnostics.PerformanceCounters; |
|
|
|
/* |
|
|
|
/* |
|
|
|
* http://www.opensource.org/licenses/lgpl-2.1.php |
|
|
|
* http://www.opensource.org/licenses/lgpl-2.1.php |
|
|
|
* JSONObject class v.1.4.1 |
|
|
|
* JSONObject class v.1.4.1 |
|
|
@ -732,8 +733,10 @@ public class JSONObject { |
|
|
|
} |
|
|
|
} |
|
|
|
public IEnumerable<string> PrintAsync(bool pretty = false) { |
|
|
|
public IEnumerable<string> PrintAsync(bool pretty = false) { |
|
|
|
StringBuilder builder = new StringBuilder(); |
|
|
|
StringBuilder builder = new StringBuilder(); |
|
|
|
|
|
|
|
#if !NETFX_CORE |
|
|
|
printWatch.Reset(); |
|
|
|
printWatch.Reset(); |
|
|
|
printWatch.Start(); |
|
|
|
printWatch.Start(); |
|
|
|
|
|
|
|
#endif |
|
|
|
foreach(IEnumerable e in StringifyAsync(0, builder, pretty)) { |
|
|
|
foreach(IEnumerable e in StringifyAsync(0, builder, pretty)) { |
|
|
|
yield return null; |
|
|
|
yield return null; |
|
|
|
} |
|
|
|
} |
|
|
@ -754,11 +757,15 @@ public class JSONObject { |
|
|
|
("reached max depth!"); |
|
|
|
("reached max depth!"); |
|
|
|
yield break; |
|
|
|
yield break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !NETFX_CORE |
|
|
|
if(printWatch.Elapsed.TotalSeconds > maxFrameTime) { |
|
|
|
if(printWatch.Elapsed.TotalSeconds > maxFrameTime) { |
|
|
|
printWatch.Reset(); |
|
|
|
printWatch.Reset(); |
|
|
|
yield return null; |
|
|
|
yield return null; |
|
|
|
printWatch.Start(); |
|
|
|
printWatch.Start(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
switch(type) { |
|
|
|
switch(type) { |
|
|
|
case Type.BAKED: |
|
|
|
case Type.BAKED: |
|
|
|
builder.Append(str); |
|
|
|
builder.Append(str); |
|
|
|