Skip to content

Detect ref, null and unknown types in YYTypeof #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Toad06
Copy link
Owner

@Toad06 Toad06 commented Aug 20, 2024

Related to #4611, object_index was already working as intended, but typeof(object_index) was incorrectly returning "struct". This now returns "ref".

While I was at it, I also added the cases for "null" and "unknown" (actually those that GameMaker wouldn't support) types.


Unrelated bug for future fix:
"caught a massive optimization problem in HTML5, where every time you move an object to a different depth, it grows an array, and the array doesn't shrink back down again, so now you have an O(n) performance problem where n is how many times you've moved depths"
"and the reason the array doesn't shrink back down again is specifically an optimization decision they made which is meant to avoid reallocating memory
BUT, array memory allocation in JS doesn't work quite in that way, because JS itself has its own optimizations for array allocation under the hood, so that optimization was self-defeating"
(note: GMS 1 is not affected)
Likely regressed by YoYoGames@0f4f72c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant