• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 Bug with HTML5 json_parse ?

Hello,

I've come across the following problem:
I am using json_stringify and json_parse to encode/decode simple json, e.g.
{"language":"en","sounds_on":1,"music_on":0}
On windows and Android targets all works well. Also with more complicated nested structures.
But on HTML5 it does not work.

When running in HTML5 json_parse throws the error:
{ message : "JSON parse error", longMessage : "JSON parse error", stacktrace : [ "function _0h("JSON parse error")

The problem is that g_var2obf is not defined and the following check
if (typeof g_var2obf !== "undefined")
is not performed when doing json_parse (unlike when doing json_stringify, where this check is made).
See attached screenshots.

broken-json_parse.png

json_stringify-is-ok.png
I believe this is a bug in Game Maker Studio. Can anyone else confirm this ?

Thank you!
 
Sorry this isn't helpful, but I am having this exact same issue right now. Suddenly none of these are working for me: json_stringify, json_parse, array_push, array_pop.
 
Top