fix: enable proper Int/Floats parsing in the debugger watch windows on HTML5 #3328
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
tldr: js was parsing ints/floats as strings, this PR makes it parse em as their proper types
Since Javascript is Javascript, on HTML5, the debug watch/tracker stuff would parse in a funny manner
lets say you had
and if you were to have
z
in a flixel debug tracker, and modify the value, it would return the new value as a string (more or less), rather than an intso then, because javascript is javascript, if you changed the value of
z
in the watch window to say, 13,x
would then be3013
(x = y + z
/x = 30 + 13 ==== 3013!! javascript is awesome!
rather than43
(x = 30 + 13 ===== 43!!
), concatenating the number and treating it as a string, rather than forcing Int.Seems like maybe neko ran into that issue before, since we have that in a dedicated compiler conditional around some code that ran
Std.parseInt()
andStd.parseFloat()
. So just removing the conditional and using that functionality on all platforms seems to fix the javascript treating everything as any time at all times quirk.I've tested on HTML5 and Mac, if Windows/Linux/Hashlink have issues, we can probably just wrap it in a
#if web
conditional rather than#if neko
(unless we still target neko... lol)