1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibJS+LibWeb: Clear exceptions after call'ing JavaScript functions

Decorated Interpreter::call() with [[nodiscard]] to provoke thinking
about the returned value at each call site. This is definitely not
perfect and we should really start thinking about slimming down the
public-facing LibJS interpreter API.

Fixes #3136.
This commit is contained in:
Andreas Kling 2020-08-14 17:31:07 +02:00
parent c5127389ca
commit bbe2d4a2d9
7 changed files with 24 additions and 9 deletions

View file

@ -65,7 +65,8 @@ public:
return;
MarkedValueList arguments(interpreter().heap());
arguments.append(setter_value);
interpreter().call(*m_setter, this_value, move(arguments));
// FIXME: It might be nice if we had a way to communicate to our caller if an exception happened after this.
(void)interpreter().call(*m_setter, this_value, move(arguments));
}
void visit_children(Cell::Visitor& visitor) override

View file

@ -737,7 +737,7 @@ bool Object::put(const PropertyName& property_name, Value value, Value receiver)
}
object = object->prototype();
if (interpreter().exception())
return {};
return false;
}
return put_own_property(*this, string_or_symbol, value, default_attributes, PutOwnPropertyMode::Put);
}