-
Notifications
You must be signed in to change notification settings - Fork 424
PP0003
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.