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