Commit f7411b5
src: make StreamBase prototype accessors robust
This PR makes the prototype accessors added by StreamBase::AddMethods
nonenumerable and checks the signatures in the accessors so they
throw instead of raising assertions when called with incompatible
receivers. They could be enumerated when inspecting the prototype
with util.inspect or the inspector protocol.
PR-URL: #16860
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>1 parent 0d4f62c commit f7411b5Copy full SHA for f7411b5
File tree
Expand file treeCollapse file tree
3 files changed
+57
-4
lines changedOpen diff view settings
Filter options
- src
- test/parallel
Expand file treeCollapse file tree
3 files changed
+57
-4
lines changedOpen diff view settings
Collapse file
+11-4Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
11 | 11 | |
12 | 12 | |
13 | 13 | |
| 14 | + |
14 | 15 | |
15 | 16 | |
16 | 17 | |
| ||
31 | 32 | |
32 | 33 | |
33 | 34 | |
34 | | - |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
35 | 39 | |
36 | 40 | |
37 | 41 | |
38 | 42 | |
39 | 43 | |
40 | | - |
| 44 | + |
| 45 | + |
41 | 46 | |
42 | 47 | |
43 | 48 | |
44 | 49 | |
45 | 50 | |
46 | 51 | |
47 | | - |
| 52 | + |
| 53 | + |
48 | 54 | |
49 | 55 | |
50 | 56 | |
51 | 57 | |
52 | 58 | |
53 | 59 | |
54 | | - |
| 60 | + |
| 61 | + |
55 | 62 | |
56 | 63 | |
57 | 64 | |
|
Collapse file
test/parallel/test-stream-base-prototype-accessors-enumerability.js
Copy file name to clipboard+19Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
Collapse file
test/parallel/test-stream-base-prototype-accessors.js
Copy file name to clipboard+27Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
0 commit comments