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 15, 2017 · 3 revisions

might not be an object, hence the in/instanceof operator might throw a TypeError

The right hand expression of an in (or instanceof) operator is an unknown value for which Prepack cannot figure out that it is definitely an object.

If the runtime value is not an object, the operation will cause a TypeError and an all subsequent code will be ignored until the error is caught. Prepack does not currently take this into account and thus may end up computing values for the heap at compile time, with the result that running Prepack over a program changes its runtime behavior.

Although Prepack could take the possibility of an exception into account it is not likely to do so in the near future because it would decrease the precision of the analysis, which could lead to further errors.

To make this error go away, consider refining the environment model so that Prepack can figure out that the right hand side expression will always result in an object.