1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

LibJS: Don't suppress GlobalObject variable lookup exceptions

In HackStudio's Debugger a custom GlobalObject is used to reflect
debugger variables into the JS scope by overriding GlobalObject's
get method. However, when throwing a custom error during that lookup
it was replaced with the generic "not found" js exception. This patch
makes it instead pass along the custom error.
This commit is contained in:
FalseHonesty 2021-04-12 20:57:30 -04:00 committed by Linus Groh
parent 6c2ec4c1a4
commit bee16bb83a
2 changed files with 4 additions and 1 deletions

View file

@ -173,6 +173,8 @@ Value VM::get_variable(const FlyString& name, GlobalObject& global_object)
for (auto* scope = current_scope(); scope; scope = scope->parent()) {
auto possible_match = scope->get_from_scope(name);
if (exception())
return {};
if (possible_match.has_value())
return possible_match.value().value;
}