Open scott-dunbar opened 7 months ago
Yeah this is an age old discussion about what to do here. Since GML objects and arrays are under the hood JS objects and arrays, they implement and call to JS toString function. I dont necessarily want to start splitting these two at that level, particularly since the llvmir generated code calls the constructor for these so the change would need to be at the call site
A potential workaround would be to change the gml "string" function to call json_stringify under the hood which would result in the same output as it previously did, but this would not change the output of obj.toString() which might be confusing
I spoke with Francisco a bit about this and we're leaning towards telling people to just use show_debug_message
/ json_stringify
in place of this. I will bring it up for further discussion
my only thought is the inconsistency is the confusing part.
show_debug_message(array) produces one result [ "0123", 456 ] and draw_text(x,y, array) produces another 0123, 456
We should probably need to make everything follow the JS standard then, so both show_debug_message and draw_text match on 0123, 456
and if a user wants to print the actual formatted output they'll need to json_stringify it.
Description
GMRT will not convert arrays to strings in a consistent manner.
As shown in the below screenshots, GMRT will display the array differently in the output and what is rendered to screen. It will also remove quotes from strings within the array
Test package 0.4.2
VM
GMRT
arraystring.zip
Expected Change
No response
Steps To Reproduce
How reliably can you recreate this issue using your steps above?
None
Which version of GameMaker are you reporting this issue for?
No response
Which platform(s) are you seeing the problem on?
No response
Compiler Log File
Sample .yyz File