Skip to content

Adjust weak_ref_alive to allow for "undefined" to match VM behavior #675

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

nommiin
Copy link

@nommiin nommiin commented Jul 4, 2025

At the moment, passing undefined into weak_ref_alive on HTML5 will cause yyError("incorrect number of arguments to weak_ref_alive"); to be thrown. On VM/YYC, the function will return undefined without error.

This behavior does not match what occurs on VM (and YYC) and what is stated in the documentation:

Note that if you supply a value that is not a weak reference, the function will return undefined.

My PR adjusts weak_ref_alive to instead check if any arguments are provided, rather than checking for undefined. This brings the functionality to match VM and YYC as of beta v2024.1400.0.836

@nommiin
Copy link
Author

nommiin commented Jul 4, 2025

Checking through the codebase, maybe it makes more sense to check if there's explicitly 1 argument but alas...

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