mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:37:35 +00:00
js: Allow for completion of lexically declared variables
This does require us to have a method which lists all the bindings in a declarative environment which is not in the spec.
This commit is contained in:
parent
0be0e7ea6e
commit
f4f1397735
3 changed files with 18 additions and 0 deletions
|
@ -142,4 +142,13 @@ void DeclarativeEnvironment::initialize_or_set_mutable_binding(Badge<ScopeNode>,
|
|||
set_mutable_binding(global_object, name, value, false);
|
||||
}
|
||||
|
||||
Vector<String> DeclarativeEnvironment::bindings() const
|
||||
{
|
||||
Vector<String> names;
|
||||
for (auto& binding : m_bindings) {
|
||||
names.empend(binding.key);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue