1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:47:35 +00:00

LibJS: Add ObjectEnvironmentRecord.[[IsWithEnvironment]] field

This is true for environments created by `with` statements, and false
for other (global) object environments.

Also add the WithBaseObject abstract operation while we're here.
This commit is contained in:
Andreas Kling 2021-06-24 13:24:44 +02:00
parent 3f8857cd21
commit 0cd65b55bd
5 changed files with 22 additions and 7 deletions

View file

@ -10,9 +10,10 @@
namespace JS {
ObjectEnvironmentRecord::ObjectEnvironmentRecord(Object& object, EnvironmentRecord* parent_scope)
ObjectEnvironmentRecord::ObjectEnvironmentRecord(Object& object, IsWithEnvironment is_with_environment, EnvironmentRecord* parent_scope)
: EnvironmentRecord(parent_scope)
, m_object(object)
, m_with_environment(is_with_environment == IsWithEnvironment::Yes)
{
}