Commit 19699be
committed
test_runner: improve mock.module options handling
This commit addresses several feedback items for mock.module():
- Fixes a potential prototype pollution vulnerability by using
ObjectAssign({ __proto__: null }, ...) for property descriptors.
- Migrates legacy option warnings to use the internal
deprecateProperty() utility for better consistency.
- Updates documentation to use "a later version" instead of "a future
major release" for deprecation timelines, as the feature is
experimental.
- Adds comprehensive test cases to ensure getter properties in
mock options are correctly preserved across both module systems.1 parent 7c2fd5c commit 19699be
File tree
3 files changed
+57
-23
lines changed- doc/api
- lib/internal/test_runner/mock
- test/parallel
3 files changed
+57
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2497 | 2497 | | |
2498 | 2498 | | |
2499 | 2499 | | |
2500 | | - | |
| 2500 | + | |
2501 | 2501 | | |
2502 | 2502 | | |
2503 | 2503 | | |
2504 | 2504 | | |
2505 | 2505 | | |
2506 | 2506 | | |
2507 | | - | |
| 2507 | + | |
2508 | 2508 | | |
2509 | 2509 | | |
2510 | 2510 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| |||
815 | 819 | | |
816 | 820 | | |
817 | 821 | | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
818 | 825 | | |
819 | 826 | | |
820 | 827 | | |
| |||
824 | 831 | | |
825 | 832 | | |
826 | 833 | | |
827 | | - | |
828 | 834 | | |
829 | 835 | | |
830 | 836 | | |
831 | 837 | | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
837 | 843 | | |
838 | 844 | | |
839 | 845 | | |
| |||
843 | 849 | | |
844 | 850 | | |
845 | 851 | | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | 852 | | |
856 | 853 | | |
857 | 854 | | |
| |||
| 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 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
693 | 730 | | |
694 | 731 | | |
695 | 732 | | |
| |||
0 commit comments