On Thu, May 17, 2018 at 10:35 AM, Luo Wu <
lwy...@pku.edu.cn> wrote:
> Hi Ben,
>
> Thanks for your reply. I am still confused about the difference between
> contexts. How does v8 restrict the JS code to access objects only in its
> context? Does it achieved by allocating objects in a given heap range, or
> associating each object with a Context property?
The latter, objects "know" what context they belong to.
More precisely, objects know what function constructed them (think
`obj.__proto__.constructor`) and functions have an explicit back-link
to their home context.