Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
Herman Venter edited this page Jun 20, 2017 · 3 revisions

might be an object with an unknown valueOf or toString or Symbol.toPrimitive method

When an unknown value is used in an expression that will attempt to convert the value to a number or a string, things can go wrong if the value turns out to be an object with a custom valueOf or toString or Symbol.toPrimitive method.

In particular, such methods might modify the global heap or they may throw an exception. If this should happen, then the values of the heap computed by Prepack will be incomplete or wrong, with the result that running Prepack over a program changes its runtime behavior.

To make this error go away, consider refining the environment model so that Prepack can figure out that converting this value will not cause such changes.