mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:37:35 +00:00
LibJS: Support deleting local variables with operator delete
To make this cleaner i also moved the logic into Reference::delete_.
This commit is contained in:
parent
af58779def
commit
064ed8279e
14 changed files with 82 additions and 10 deletions
|
@ -62,6 +62,11 @@ void LexicalEnvironment::put_to_scope(const FlyString& name, Variable variable)
|
|||
m_variables.set(name, variable);
|
||||
}
|
||||
|
||||
bool LexicalEnvironment::delete_from_scope(FlyString const& name)
|
||||
{
|
||||
return m_variables.remove(name);
|
||||
}
|
||||
|
||||
bool LexicalEnvironment::has_super_binding() const
|
||||
{
|
||||
return m_environment_record_type == EnvironmentRecordType::Function && this_binding_status() != ThisBindingStatus::Lexical && m_home_object.is_object();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue