瀏覽代碼

[lua] Respect lua-vanilla for Json.parse (#10915)

* Update JsonParser.hx

Respect lua-vanilla for Json.parse

* fix typo
inklit 2 年之前
父節點
當前提交
b4cf007cdb
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      std/lua/_std/haxe/format/JsonParser.hx

+ 4 - 0
std/lua/_std/haxe/format/JsonParser.hx

@@ -42,7 +42,11 @@ class JsonParser {
 		If `str` is null, the result is unspecified.
 		If `str` is null, the result is unspecified.
 	**/
 	**/
 	static public inline function parse(str:String):Dynamic {
 	static public inline function parse(str:String):Dynamic {
+		#if lua_vanilla
+		return new JsonParser(str).doParse();
+		#else
 		return lua.lib.hxluasimdjson.Json.parse(str);
 		return lua.lib.hxluasimdjson.Json.parse(str);
+		#end
 	}
 	}
 
 
 	var str:String;
 	var str:String;