Skip to content
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

Bug: getStaticValue doesn't track references types correctly #154

Open
RunDevelopment opened this issue Oct 14, 2023 · 1 comment
Open

Comments

@RunDevelopment
Copy link

Example: const a = []; a === a will evaluate to false.

This is because getStaticValue evaluates each reference to a variable separately, so we get different objects with the same value each time. However, they should be the same value.

Solution: Cache the value of each variable.

Non-solution: Change the === operator (among others) to not evaluate the equality of non-value types. This solution simply doesn't scale as built-in safe functions might use === under the hood.


Transferred from mysticatea#32

@github-actions github-actions bot added the Stale label Dec 13, 2023
Copy link

This issue has been automatically closed because we haven't received a response from the original author 🙈. This automation helps keep the issue tracker clean from issues that aren't actionable. Please reach out if you have more information for us! 🙂

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2023
@ota-meshi ota-meshi reopened this Dec 21, 2023
@ota-meshi ota-meshi removed the Stale label Dec 21, 2023
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

No branches or pull requests

2 participants