mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:37:44 +00:00
LibJS: Convert resolve_binding() to ThrowCompletionOr
The spec has a note stating that resolve binding will always return a reference whose [[ReferencedName]] field is name. However this is not correct as the underlying method GetIdentifierReference may throw on env.HasBinding(name) thus it can throw. However, there are some scenarios where it cannot throw because the reference is known to exist in that case we use MUST with a comment.
This commit is contained in:
parent
dfaa6c910c
commit
676554d3f8
8 changed files with 44 additions and 42 deletions
|
@ -192,7 +192,7 @@ public:
|
|||
ScopeType unwind_until() const { return m_unwind_until; }
|
||||
FlyString unwind_until_label() const { return m_unwind_until_label; }
|
||||
|
||||
Reference resolve_binding(FlyString const&, Environment* = nullptr);
|
||||
ThrowCompletionOr<Reference> resolve_binding(FlyString const&, Environment* = nullptr);
|
||||
Reference get_identifier_reference(Environment*, FlyString, bool strict, size_t hops = 0);
|
||||
|
||||
template<typename T, typename... Args>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue