1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:27:34 +00:00

LibJS: Improve ResolveBinding + add GetIdentifierReference

ResolveBinding now matches the spec, while the non-conforming parts
are moved to GetIdentifierReference.

Implementing this properly requires variable bindings.
This commit is contained in:
Andreas Kling 2021-07-02 21:54:56 +02:00
parent 4b87dd5c5c
commit fd43d1e205
3 changed files with 36 additions and 9 deletions

View file

@ -204,7 +204,8 @@ public:
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);
Reference resolve_binding(GlobalObject&, FlyString const&, Environment* = nullptr);
Reference resolve_binding(FlyString const&, Environment* = nullptr);
Reference get_identifier_reference(Environment*, FlyString const&, bool strict);
template<typename T, typename... Args>
void throw_exception(GlobalObject& global_object, Args&&... args)