3 PP0002
Herman Venter edited this page 2017-06-20 16:45:20 -07:00

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.