Commit 8d76db8
module: refactor to use iterable-weak-map
Using an iterable WeakMap (a data-structure that uses WeakRef and
WeakMap), we are able to: stop relying on Module._cache to
serialize source maps; stop requiring an error object when calling
findSourceMap().
PR-URL: #35915
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>1 parent 1dd744a commit 8d76db8Copy full SHA for 8d76db8
File tree
Expand file treeCollapse file tree
16 files changed
+281
-62
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal
- per_context
- source_map
- util
- test
- fixtures/source-map
- parallel
Expand file treeCollapse file tree
16 files changed
+281
-62
lines changedOpen diff view settings
Collapse file
+4-9Lines changed: 4 additions & 9 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
135 | 135 | |
136 | 136 | |
137 | 137 | |
138 | | - |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
139 | 142 | |
140 | 143 | |
141 | 144 | |
142 | 145 | |
143 | 146 | |
144 | 147 | |
145 | 148 | |
146 | | - |
147 | 149 | |
148 | 150 | |
149 | 151 | |
150 | 152 | |
151 | 153 | |
152 | | - |
153 | | - |
154 | | - |
155 | | - |
156 | | - |
157 | | - |
158 | 154 | |
159 | 155 | |
160 | 156 | |
| ||
204 | 200 | |
205 | 201 | |
206 | 202 | |
207 | | - |
208 | 203 | |
209 | 204 | |
210 | 205 | |
|
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
967 | 967 | |
968 | 968 | |
969 | 969 | |
970 | | - |
| 970 | + |
971 | 971 | |
972 | 972 | |
973 | 973 | |
|
Collapse file
lib/internal/per_context/primordials.js
Copy file name to clipboardExpand all lines: lib/internal/per_context/primordials.js+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
86 | 86 | |
87 | 87 | |
88 | 88 | |
| 89 | + |
89 | 90 | |
90 | 91 | |
91 | 92 | |
|
Collapse file
lib/internal/source_map/prepare_stack_trace.js
Copy file name to clipboardExpand all lines: lib/internal/source_map/prepare_stack_trace.js+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
57 | 57 | |
58 | 58 | |
59 | 59 | |
60 | | - |
| 60 | + |
61 | 61 | |
62 | 62 | |
63 | 63 | |
| ||
119 | 119 | |
120 | 120 | |
121 | 121 | |
| 122 | + |
122 | 123 | |
123 | 124 | |
124 | 125 | |
|
Collapse file
lib/internal/source_map/source_map_cache.js
Copy file name to clipboardExpand all lines: lib/internal/source_map/source_map_cache.js+38-50Lines changed: 38 additions & 50 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
| 4 | + |
4 | 5 | |
5 | 6 | |
6 | 7 | |
7 | 8 | |
8 | 9 | |
9 | 10 | |
10 | 11 | |
11 | | - |
12 | | - |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
13 | 16 | |
14 | 17 | |
15 | 18 | |
| ||
27 | 30 | |
28 | 31 | |
29 | 32 | |
| 33 | + |
30 | 34 | |
31 | 35 | |
32 | 36 | |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | | - |
40 | | - |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
41 | 44 | |
42 | 45 | |
43 | 46 | |
| ||
70 | 73 | |
71 | 74 | |
72 | 75 | |
73 | | - |
74 | | - |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
75 | 80 | |
76 | 81 | |
77 | 82 | |
78 | 83 | |
79 | | - |
80 | 84 | |
81 | 85 | |
82 | 86 | |
| ||
120 | 124 | |
121 | 125 | |
122 | 126 | |
123 | | - |
| 127 | + |
124 | 128 | |
125 | 129 | |
126 | 130 | |
| ||
139 | 143 | |
140 | 144 | |
141 | 145 | |
142 | | - |
143 | | - |
| 146 | + |
| 147 | + |
144 | 148 | |
145 | 149 | |
146 | 150 | |
| ||
207 | 211 | |
208 | 212 | |
209 | 213 | |
210 | | - |
211 | | - |
212 | | - |
213 | | - |
214 | | - |
215 | 214 | |
216 | | - |
217 | | - |
218 | | - |
219 | | - |
220 | | - |
221 | | - |
222 | | - |
223 | | - |
224 | | - |
225 | | - |
226 | | - |
227 | | - |
228 | | - |
229 | | - |
230 | | - |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | + |
| 219 | + |
| 220 | + |
231 | 221 | |
232 | 222 | |
233 | 223 | |
234 | | - |
235 | | - |
236 | | - |
237 | | - |
238 | | - |
239 | | - |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
240 | 228 | |
241 | 229 | |
242 | 230 | |
243 | | - |
244 | | - |
245 | | - |
246 | | - |
247 | | - |
| 231 | + |
248 | 232 | |
249 | | - |
250 | | - |
251 | | - |
| 233 | + |
| 234 | + |
| 235 | + |
| 236 | + |
| 237 | + |
| 238 | + |
| 239 | + |
252 | 240 | |
253 | 241 | |
254 | 242 | |
|
Collapse file
lib/internal/util/iterable_weak_map.js
Copy file name to clipboard+86Lines changed: 86 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 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
227 | 227 | |
228 | 228 | |
229 | 229 | |
| 230 | + |
230 | 231 | |
231 | 232 | |
232 | 233 | |
|
Collapse file
test/fixtures/source-map/throw-on-require-entry.js
Copy file name to clipboardExpand all lines: test/fixtures/source-map/throw-on-require-entry.js+4Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file
test/fixtures/source-map/throw-on-require-entry.js.map
Copy file name to clipboardExpand all lines: test/fixtures/source-map/throw-on-require-entry.js.map+1Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file
test/fixtures/source-map/throw-on-require.js
Copy file name to clipboardExpand all lines: test/fixtures/source-map/throw-on-require.js+15Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments