mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 22:22:55 +00:00
LibJS: Handle getter exception in JSONObject::serialize_json_property()
In the case of an exception in a property getter function we would not return early, and a subsequent attempt to call the replacer function would crash the interpreter due to call_internal() asserting. Fixes #3548.
This commit is contained in:
parent
e1965a5a8e
commit
c0e4353bde
Notes:
sideshowbarker
2024-07-19 02:20:17 +09:00
Author: https://github.com/linusg
Commit: c0e4353bde
Pull-request: https://github.com/SerenityOS/serenity/pull/3551
Issue: https://github.com/SerenityOS/serenity/issues/3548
2 changed files with 12 additions and 0 deletions
|
@ -0,0 +1,10 @@
|
|||
test("Issue #3548, exception in property getter with replacer function", () => {
|
||||
const o = {
|
||||
get foo() {
|
||||
throw Error();
|
||||
},
|
||||
};
|
||||
expect(() => {
|
||||
JSON.stringify(o, (_, value) => value);
|
||||
}).toThrow(Error);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue