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

LibJS: Implement non standard error.stack attribute

All other browser already support this feature.
There is a Stage 1 proposal to standardize this, but it does not seem
to be active.
This commit is contained in:
Hendiadyoin1 2022-02-06 17:00:28 +01:00 committed by Linus Groh
parent 8c3942d90c
commit 89c82abf1f
6 changed files with 100 additions and 0 deletions

View file

@ -23,7 +23,13 @@ public:
explicit Error(Object& prototype);
virtual ~Error() override = default;
String const& stack_string() const { return m_stack_string; }
ThrowCompletionOr<void> install_error_cause(Value options);
private:
void populate_stack();
String m_stack_string {};
};
// NOTE: Making these inherit from Error is not required by the spec but