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 · 1 revision

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.

Clone this wiki locally