Commit 460cc62
process: code cleanup for nextTick
Fix a few edge cases and non-obvious issues with nextTick:
1. Emit destroy hook in a try-finally rather than triggering
it before the callback runs.
2. Re-word comment for processPromiseRejections and make sure
it returns true in the rejectionHandled case too.
3. Small readability improvements.
PR-URL: #28047
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>1 parent d4bb88e commit 460cc62Copy full SHA for 460cc62
File tree
Expand file treeCollapse file tree
3 files changed
+73
-29
lines changedOpen diff view settings
Filter options
- lib/internal/process
- test/async-hooks
Expand file treeCollapse file tree
3 files changed
+73
-29
lines changedOpen diff view settings
Collapse file
lib/internal/process/promises.js
Copy file name to clipboardExpand all lines: lib/internal/process/promises.js+8-5Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
139 | 139 | |
140 | 140 | |
141 | 141 | |
142 | | - |
143 | | - |
| 142 | + |
| 143 | + |
| 144 | + |
144 | 145 | |
| 146 | + |
| 147 | + |
145 | 148 | |
146 | 149 | |
147 | 150 | |
148 | 151 | |
149 | 152 | |
150 | 153 | |
151 | 154 | |
152 | | - |
153 | 155 | |
154 | 156 | |
155 | 157 | |
| ||
167 | 169 | |
168 | 170 | |
169 | 171 | |
170 | | - |
| 172 | + |
171 | 173 | |
172 | | - |
| 174 | + |
| 175 | + |
173 | 176 | |
174 | 177 | |
175 | 178 | |
|
Collapse file
lib/internal/process/task_queues.js
Copy file name to clipboardExpand all lines: lib/internal/process/task_queues.js+16-24Lines changed: 16 additions & 24 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
65 | 65 | |
66 | 66 | |
67 | 67 | |
68 | | - |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | | - |
74 | | - |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
84 | | - |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
85 | 79 | |
86 | 80 | |
87 | 81 | |
88 | | - |
89 | 82 | |
90 | 83 | |
| 84 | + |
91 | 85 | |
92 | 86 | |
93 | 87 | |
94 | 88 | |
95 | | - |
| 89 | + |
96 | 90 | |
97 | 91 | |
98 | 92 | |
99 | 93 | |
| 94 | + |
100 | 95 | |
101 | 96 | |
102 | 97 | |
103 | 98 | |
104 | | - |
105 | | - |
106 | | - |
107 | | - |
| 99 | + |
108 | 100 | |
109 | 101 | |
110 | 102 | |
| ||
132 | 124 | |
133 | 125 | |
134 | 126 | |
135 | | - |
| 127 | + |
136 | 128 | |
137 | 129 | |
138 | 130 | |
|
Collapse file
test/async-hooks/test-late-hook-enable.js
Copy file name to clipboard+49Lines changed: 49 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 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
0 commit comments