mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
js: Pretty-print custom error types
This commit is contained in:
parent
11d1950e74
commit
15fafdc645
Notes:
sideshowbarker
2024-07-18 00:43:26 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/15fafdc645e Pull-request: https://github.com/SerenityOS/serenity/pull/11049 Reviewed-by: https://github.com/linusg ✅
1 changed files with 7 additions and 0 deletions
|
@ -742,6 +742,13 @@ static void print_value(JS::Value value, HashTable<JS::Object*>& seen_objects)
|
|||
return print_date(object, seen_objects);
|
||||
if (is<JS::Error>(object))
|
||||
return print_error(object, seen_objects);
|
||||
|
||||
auto prototype_or_error = object.internal_get_prototype_of();
|
||||
if (prototype_or_error.has_value() && prototype_or_error.value() == object.global_object().error_prototype())
|
||||
return print_error(object, seen_objects);
|
||||
vm->clear_exception();
|
||||
vm->stop_unwind();
|
||||
|
||||
if (is<JS::RegExpObject>(object))
|
||||
return print_regexp_object(object, seen_objects);
|
||||
if (is<JS::Map>(object))
|
||||
|
|
Loading…
Reference in a new issue