You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
RunDevelopment
changed the title
getStaticValue doesn't track references correctlygetStaticValue doesn't track references types correctly
Aug 15, 2021
Example:
const a = []; a === a
will evaluate tofalse
.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.The text was updated successfully, but these errors were encountered: