Commit eddde6c
errors: don't rekey on primitive type
If an error is thrown before a module is loaded, we attempt to cache
source map against error object, rather than module object. We
can't do this if the error is a primitive type
Fixes #38945
PR-URL: #39025
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>1 parent d2b972e commit eddde6cCopy full SHA for eddde6c
File tree
Expand file treeCollapse file tree
5 files changed
+28
-24
lines changedOpen diff view settings
Filter options
- lib/internal
- modules/cjs
- source_map
- test
- fixtures/source-map
- parallel
Expand file treeCollapse file tree
5 files changed
+28
-24
lines changedOpen diff view settings
Collapse file
lib/internal/modules/cjs/loader.js
Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/loader.js+1-15Lines changed: 1 addition & 15 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
74 | 74 | |
75 | 75 | |
76 | 76 | |
77 | | - |
78 | 77 | |
79 | | - |
80 | 78 | |
81 | 79 | |
82 | 80 | |
| ||
815 | 813 | |
816 | 814 | |
817 | 815 | |
818 | | - |
819 | | - |
820 | | - |
821 | | - |
822 | | - |
823 | | - |
824 | | - |
825 | | - |
826 | | - |
827 | | - |
828 | | - |
829 | | - |
830 | | - |
| 816 | + |
831 | 817 | |
832 | 818 | |
833 | 819 | |
|
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-9Lines changed: 0 additions & 9 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
172 | 172 | |
173 | 173 | |
174 | 174 | |
175 | | - |
176 | | - |
177 | | - |
178 | | - |
179 | | - |
180 | | - |
181 | | - |
182 | | - |
183 | 175 | |
184 | 176 | |
185 | 177 | |
| ||
240 | 232 | |
241 | 233 | |
242 | 234 | |
243 | | - |
244 | 235 | |
245 | 236 | |
Collapse file
test/fixtures/source-map/throw-string-original.js
Copy file name to clipboard+8Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
Collapse file
test/fixtures/source-map/throw-string.js
Copy file name to clipboardExpand all lines: test/fixtures/source-map/throw-string.js+2Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file
test/parallel/test-source-map-enable.js
Copy file name to clipboardExpand all lines: test/parallel/test-source-map-enable.js+17Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
307 | 307 | |
308 | 308 | |
309 | 309 | |
| 310 | + |
| 311 | + |
| 312 | + |
| 313 | + |
| 314 | + |
| 315 | + |
| 316 | + |
| 317 | + |
| 318 | + |
| 319 | + |
| 320 | + |
| 321 | + |
| 322 | + |
| 323 | + |
| 324 | + |
| 325 | + |
| 326 | + |
310 | 327 | |
311 | 328 | |
312 | 329 | |
|
0 commit comments