Commit 1040e72
util: fix inspection of errors with tampered name or stack property
This makes sure that `util.inspect()` does not throw while inspecting
errors that have the name or stack property set to a different type
than string.
Fixes: #30572
PR-URL: #30576
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent 5ef4dce commit 1040e72Copy full SHA for 1040e72
File tree
Expand file treeCollapse file tree
2 files changed
+32
-3
lines changedOpen diff view settings
Filter options
- lib/internal/util
- test/parallel
Expand file treeCollapse file tree
2 files changed
+32
-3
lines changedOpen diff view settings
Collapse file
lib/internal/util/inspect.js
Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
932 | 932 | |
933 | 933 | |
934 | 934 | |
935 | | - |
| 935 | + |
| 936 | + |
| 937 | + |
936 | 938 | |
937 | 939 | |
938 | 940 | |
939 | | - |
940 | | - |
941 | 941 | |
942 | 942 | |
943 | 943 | |
|
Collapse file
test/parallel/test-util-inspect.js
Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js+29Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
690 | 690 | |
691 | 691 | |
692 | 692 | |
| 693 | + |
| 694 | + |
| 695 | + |
| 696 | + |
| 697 | + |
| 698 | + |
| 699 | + |
| 700 | + |
| 701 | + |
| 702 | + |
| 703 | + |
| 704 | + |
| 705 | + |
| 706 | + |
| 707 | + |
| 708 | + |
| 709 | + |
| 710 | + |
| 711 | + |
| 712 | + |
| 713 | + |
| 714 | + |
| 715 | + |
| 716 | + |
| 717 | + |
| 718 | + |
| 719 | + |
| 720 | + |
| 721 | + |
693 | 722 | |
694 | 723 | |
695 | 724 | |
|
0 commit comments