Commit b0e3aec
util: inspect (user defined) prototype properties
This is only active if the `showHidden` option is truthy.
The implementation is a trade-off between accuracy and performance.
This will miss properties such as properties added to built-in data
types.
The goal is mainly to visualize prototype getters and setters such as:
class Foo {
ownProperty = true
get bar() {
return 'Hello world!'
}
}
const a = new Foo()
The `bar` property is a non-enumerable property on the prototype while
`ownProperty` will be set directly on the created instance.
The output is similar to the one of Chromium when inspecting objects
closer. The output from Firefox is difficult to compare, since it's
always a structured interactive output and was therefore not taken
into account.
Backport-PR-URL: #31431
PR-URL: #30768
Fixes: #30183
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>1 parent 40a724c commit b0e3aecCopy full SHA for b0e3aec
File tree
Expand file treeCollapse file tree
4 files changed
+198
-22
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal/util
- test/parallel
Expand file treeCollapse file tree
4 files changed
+198
-22
lines changedOpen diff view settings
Collapse file
+6-1Lines changed: 6 additions & 1 deletion
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
398 | 398 | |
399 | 399 | |
400 | 400 | |
| 401 | + |
| 402 | + |
| 403 | + |
| 404 | + |
401 | 405 | |
402 | 406 | |
403 | 407 | |
| ||
458 | 462 | |
459 | 463 | |
460 | 464 | |
461 | | - |
| 465 | + |
| 466 | + |
462 | 467 | |
463 | 468 | |
464 | 469 | |
|
Collapse file
lib/internal/util/inspect.js
Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js+100-16Lines changed: 100 additions & 16 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
450 | 450 | |
451 | 451 | |
452 | 452 | |
453 | | - |
| 453 | + |
454 | 454 | |
455 | 455 | |
456 | 456 | |
457 | 457 | |
458 | 458 | |
459 | 459 | |
460 | 460 | |
| 461 | + |
| 462 | + |
| 463 | + |
| 464 | + |
| 465 | + |
| 466 | + |
461 | 467 | |
462 | 468 | |
463 | 469 | |
| ||
477 | 483 | |
478 | 484 | |
479 | 485 | |
480 | | - |
| 486 | + |
| 487 | + |
481 | 488 | |
482 | 489 | |
483 | 490 | |
| ||
490 | 497 | |
491 | 498 | |
492 | 499 | |
| 500 | + |
| 501 | + |
| 502 | + |
| 503 | + |
| 504 | + |
| 505 | + |
| 506 | + |
| 507 | + |
| 508 | + |
| 509 | + |
| 510 | + |
| 511 | + |
| 512 | + |
| 513 | + |
| 514 | + |
| 515 | + |
| 516 | + |
| 517 | + |
| 518 | + |
| 519 | + |
| 520 | + |
| 521 | + |
| 522 | + |
| 523 | + |
| 524 | + |
| 525 | + |
| 526 | + |
| 527 | + |
| 528 | + |
| 529 | + |
| 530 | + |
| 531 | + |
| 532 | + |
| 533 | + |
| 534 | + |
| 535 | + |
| 536 | + |
| 537 | + |
| 538 | + |
| 539 | + |
| 540 | + |
| 541 | + |
| 542 | + |
| 543 | + |
| 544 | + |
| 545 | + |
| 546 | + |
| 547 | + |
| 548 | + |
| 549 | + |
| 550 | + |
| 551 | + |
| 552 | + |
| 553 | + |
| 554 | + |
| 555 | + |
| 556 | + |
| 557 | + |
| 558 | + |
| 559 | + |
| 560 | + |
| 561 | + |
493 | 562 | |
494 | 563 | |
495 | 564 | |
| ||
693 | 762 | |
694 | 763 | |
695 | 764 | |
| 765 | + |
| 766 | + |
| 767 | + |
| 768 | + |
| 769 | + |
| 770 | + |
| 771 | + |
| 772 | + |
| 773 | + |
| 774 | + |
696 | 775 | |
697 | | - |
698 | 776 | |
699 | 777 | |
700 | 778 | |
| ||
724 | 802 | |
725 | 803 | |
726 | 804 | |
727 | | - |
| 805 | + |
728 | 806 | |
729 | 807 | |
730 | 808 | |
731 | 809 | |
732 | 810 | |
733 | 811 | |
734 | | - |
| 812 | + |
735 | 813 | |
736 | 814 | |
737 | 815 | |
738 | 816 | |
739 | 817 | |
740 | 818 | |
741 | | - |
| 819 | + |
742 | 820 | |
743 | 821 | |
744 | 822 | |
| ||
773 | 851 | |
774 | 852 | |
775 | 853 | |
776 | | - |
| 854 | + |
777 | 855 | |
778 | 856 | |
779 | 857 | |
780 | 858 | |
781 | | - |
| 859 | + |
782 | 860 | |
783 | 861 | |
784 | 862 | |
| ||
788 | 866 | |
789 | 867 | |
790 | 868 | |
791 | | - |
| 869 | + |
| 870 | + |
792 | 871 | |
| 872 | + |
793 | 873 | |
794 | 874 | |
795 | 875 | |
| ||
798 | 878 | |
799 | 879 | |
800 | 880 | |
801 | | - |
| 881 | + |
802 | 882 | |
803 | 883 | |
804 | 884 | |
805 | 885 | |
806 | | - |
| 886 | + |
807 | 887 | |
808 | 888 | |
809 | 889 | |
| ||
814 | 894 | |
815 | 895 | |
816 | 896 | |
817 | | - |
| 897 | + |
818 | 898 | |
819 | 899 | |
820 | 900 | |
| ||
838 | 918 | |
839 | 919 | |
840 | 920 | |
841 | | - |
| 921 | + |
842 | 922 | |
843 | 923 | |
844 | 924 | |
| ||
858 | 938 | |
859 | 939 | |
860 | 940 | |
861 | | - |
| 941 | + |
862 | 942 | |
863 | 943 | |
864 | 944 | |
| ||
886 | 966 | |
887 | 967 | |
888 | 968 | |
| 969 | + |
| 970 | + |
| 971 | + |
889 | 972 | |
890 | 973 | |
891 | 974 | |
| ||
1349 | 1432 | |
1350 | 1433 | |
1351 | 1434 | |
| 1435 | + |
1352 | 1436 | |
1353 | 1437 | |
1354 | 1438 | |
| ||
1497 | 1581 | |
1498 | 1582 | |
1499 | 1583 | |
1500 | | - |
| 1584 | + |
1501 | 1585 | |
1502 | 1586 | |
1503 | | - |
| 1587 | + |
1504 | 1588 | |
1505 | 1589 | |
1506 | 1590 | |
|
Collapse file
test/parallel/test-util-inspect.js
Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js+79-1Lines changed: 79 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
391 | 391 | |
392 | 392 | |
393 | 393 | |
| 394 | + |
| 395 | + |
394 | 396 | |
395 | | - |
| 397 | + |
| 398 | + |
| 399 | + |
| 400 | + |
| 401 | + |
| 402 | + |
| 403 | + |
| 404 | + |
| 405 | + |
| 406 | + |
| 407 | + |
| 408 | + |
| 409 | + |
| 410 | + |
| 411 | + |
396 | 412 | |
397 | 413 | |
398 | 414 | |
| ||
2585 | 2601 | |
2586 | 2602 | |
2587 | 2603 | |
| 2604 | + |
| 2605 | + |
| 2606 | + |
| 2607 | + |
| 2608 | + |
| 2609 | + |
| 2610 | + |
| 2611 | + |
| 2612 | + |
| 2613 | + |
| 2614 | + |
| 2615 | + |
| 2616 | + |
| 2617 | + |
| 2618 | + |
| 2619 | + |
| 2620 | + |
| 2621 | + |
| 2622 | + |
| 2623 | + |
| 2624 | + |
| 2625 | + |
| 2626 | + |
| 2627 | + |
| 2628 | + |
| 2629 | + |
| 2630 | + |
| 2631 | + |
| 2632 | + |
| 2633 | + |
| 2634 | + |
| 2635 | + |
| 2636 | + |
| 2637 | + |
| 2638 | + |
| 2639 | + |
| 2640 | + |
| 2641 | + |
| 2642 | + |
| 2643 | + |
| 2644 | + |
| 2645 | + |
| 2646 | + |
| 2647 | + |
| 2648 | + |
| 2649 | + |
| 2650 | + |
| 2651 | + |
| 2652 | + |
| 2653 | + |
| 2654 | + |
| 2655 | + |
| 2656 | + |
| 2657 | + |
| 2658 | + |
| 2659 | + |
| 2660 | + |
| 2661 | + |
| 2662 | + |
| 2663 | + |
| 2664 | + |
| 2665 | + |
Collapse file
test/parallel/test-whatwg-encoding-custom-textdecoder.js
Copy file name to clipboardExpand all lines: test/parallel/test-whatwg-encoding-custom-textdecoder.js+13-4Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
113 | 113 | |
114 | 114 | |
115 | 115 | |
116 | | - |
117 | | - |
118 | | - |
119 | | - |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
120 | 129 | |
121 | 130 | |
122 | 131 | |
|
0 commit comments