mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:57:44 +00:00
LibJS: Remove unused delete_variable method in VM
This commit is contained in:
parent
e6a97f1b7b
commit
53cc7e8398
2 changed files with 0 additions and 24 deletions
|
@ -168,29 +168,6 @@ void VM::set_variable(const FlyString& name, Value value, GlobalObject& global_o
|
|||
global_object.set(name, value, Object::ShouldThrowExceptions::Yes);
|
||||
}
|
||||
|
||||
bool VM::delete_variable(FlyString const& name)
|
||||
{
|
||||
Environment* specific_scope = nullptr;
|
||||
Optional<Variable> possible_match;
|
||||
if (!m_execution_context_stack.is_empty()) {
|
||||
for (auto* environment = lexical_environment(); environment; environment = environment->outer_environment()) {
|
||||
possible_match = environment->get_from_environment(name);
|
||||
if (possible_match.has_value()) {
|
||||
specific_scope = environment;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!possible_match.has_value())
|
||||
return false;
|
||||
if (possible_match.value().declaration_kind == DeclarationKind::Const)
|
||||
return false;
|
||||
|
||||
VERIFY(specific_scope);
|
||||
return specific_scope->delete_from_environment(name);
|
||||
}
|
||||
|
||||
void VM::assign(const FlyString& target, Value value, GlobalObject& global_object, bool first_assignment, Environment* specific_scope)
|
||||
{
|
||||
set_variable(target, move(value), global_object, first_assignment, specific_scope);
|
||||
|
|
|
@ -206,7 +206,6 @@ public:
|
|||
|
||||
Value get_variable(const FlyString& name, GlobalObject&);
|
||||
void set_variable(const FlyString& name, Value, GlobalObject&, bool first_assignment = false, Environment* specific_scope = nullptr);
|
||||
bool delete_variable(FlyString const& name);
|
||||
void assign(const Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>>& target, Value, GlobalObject&, bool first_assignment = false, Environment* specific_scope = nullptr);
|
||||
void assign(const FlyString& target, Value, GlobalObject&, bool first_assignment = false, Environment* specific_scope = nullptr);
|
||||
void assign(const NonnullRefPtr<BindingPattern>& target, Value, GlobalObject&, bool first_assignment = false, Environment* specific_scope = nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue