Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
delete more code
  • Loading branch information
bcoe committed Jun 13, 2021
commit 4af02fd96d8b899d59df906d67950f1a757b19d1
14 changes: 1 addition & 13 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ module.exports = {

const { NativeModule } = require('internal/bootstrap/loaders');
const {
getSourceMapsEnabled,
maybeCacheSourceMap,
} = require('internal/source_map/source_map_cache');
const { pathToFileURL, fileURLToPath, isURLInstance } = require('internal/url');
Expand Down Expand Up @@ -814,18 +813,7 @@ Module._load = function(request, parent, isMain) {

let threw = true;
try {
// Intercept exceptions that occur during the first tick and rekey them
// on error instance rather than module instance (which will immediately be
// garbage collected).
if (getSourceMapsEnabled()) {
try {
module.load(filename);
} catch (err) {
throw err; /* node-do-not-add-exception-line */
}
} else {
module.load(filename);
}
module.load(filename);
threw = false;
} finally {
if (threw) {
Expand Down