-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
errors: remove source map rekey logic #39025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,7 +175,11 @@ function sourcesToAbsolute(baseURL, data) { | |
| // Move source map from garbage collected module to alternate key. | ||
| function rekeySourceMap(cjsModuleInstance, newInstance) { | ||
| const sourceMap = cjsSourceMapCache.get(cjsModuleInstance); | ||
| if (sourceMap) { | ||
| // If an exception occurs before a module finishes loading it will removed | ||
| // from the module cache and our WeakMap. To allow a source map to still be | ||
| // applied to the stack trace when this happens, we rekey on the thrown error. | ||
| // This is only possible if the error is an object and not a primitive type. | ||
| if (sourceMap && typeof newInstance === 'object') { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aduh95 I did some testing it no longer seems like that rekey logic is needed to ensure that source maps are written to disk prior to exit. Perhaps this is because of refactors that have taken place related to source map serialization? Or perhaps a Either way, no tests fail if we simply remove the rekey logic.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! I still think it'd be interesting to have a test case with a |
||
| cjsSourceMapCache.set(newInstance, sourceMap); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /* | ||
| * comments dropped by uglify. | ||
| */ | ||
| function Hello() { | ||
| throw 'goodbye'; | ||
| } | ||
|
|
||
| Hello(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.