1 PP0007
Herman Venter edited this page 2017-06-20 14:37:57 -07:00

with object must be a known value

A with statement has an object expression that is an unknown value or a partially unknown object at Prepack time.

This makes it impossible for Prepack to know if a particular property name that is not present in the with object at Prepack time will actually be present at runtime. This can lead to Prepack generating code that will behave differently from the original at runtime. Moreover, even when Prepack can deal abstractly with the ambiguity, the resulting code will be very inefficient, which negates the value of using Prepack in the first place.

To fix this error, simply get rid of the with statement. This is always a good idea, so just do it.