From ac1f0af11a02305977e8759ccde27fd7c38b915c Mon Sep 17 00:00:00 2001 From: Fritz <1914610+jackerley@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:36:37 +0000 Subject: [PATCH] [json_stringify] Modifying test to account for differences between GMRT and current runtime numbers are callable in current runtime as they may be script indices (legacy behaviour) Note, another part of this fix is being handled in runtime develop branch https://github.com/YoYoGames/GameMaker-Bugs/issues/14335 --- .../BasicJsonTestSuite/BasicJsonTestSuite.gml | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/projects/xUnit/scripts/BasicJsonTestSuite/BasicJsonTestSuite.gml b/projects/xUnit/scripts/BasicJsonTestSuite/BasicJsonTestSuite.gml index 618aa99c..c32a9392 100644 --- a/projects/xUnit/scripts/BasicJsonTestSuite/BasicJsonTestSuite.gml +++ b/projects/xUnit/scripts/BasicJsonTestSuite/BasicJsonTestSuite.gml @@ -389,11 +389,23 @@ function BasicJsonTestSuite() : TestSuite() constructor { _output = json_parse(_jsonStr); - var _test = { - version: 2, - myArray: "array", - myFunction: "func", - } + if(runtime_gmrt()) + { + + var _test = { + version: 2, + myArray: "array", + myFunction: "func", + } + } + else { + //In current runtime 2 could be a script index so is_callable returns true + var _test = { + version: "func", + myArray: "array", + myFunction: "func", + } + } assert_struct_equals(_test, _output, "json_stringify ( struct:local, ..., replacer ), use custom replace funnction (structs are not equal)") });