diff options
author | Linus Groh <mail@linusgroh.de> | 2021-10-09 17:07:32 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-10-09 21:53:47 +0100 |
commit | fbb176c926e84d0ed768700ab2af0449de0457ed (patch) | |
tree | 5ff4b12a7c2a12895b5aeec24efe631c889fc5dc /Userland/Libraries/LibJS/Runtime/VM.cpp | |
parent | 617d3cd3d3d03fc5c2af8cfe71d8c34be2031bc0 (diff) | |
download | serenity-fbb176c926e84d0ed768700ab2af0449de0457ed.zip |
LibJS: Convert has_binding() to ThrowCompletionOr
Also add spec step comments to it while we're here.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/VM.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/VM.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index b0f37553af..02fb5e0a2f 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -445,9 +445,7 @@ Reference VM::get_identifier_reference(Environment* environment, FlyString name, } Optional<size_t> index; - auto exists = environment->has_binding(name, &index); - if (exception()) - return {}; + auto exists = TRY_OR_DISCARD(environment->has_binding(name, &index)); Optional<EnvironmentCoordinate> environment_coordinate; if (index.has_value()) |