Skip to content

Commit 9f16aa7

Browse files
committed
Fix failing tests
1 parent 9999e1d commit 9f16aa7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

source-map-support.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,13 @@ function getErrorSource(error) {
377377
var contents = fileContentsCache[source];
378378

379379
// Support files on disk
380-
if (!contents && fs.existsSync(source)) {
381-
contents = fs.readFileSync(source, 'utf8');
380+
try {
381+
const fs = require('fs');
382+
if (!contents && fs.existsSync(source)) {
383+
contents = fs.readFileSync(source, 'utf8');
384+
}
385+
} catch (err) {
386+
/* NOP */
382387
}
383388

384389
// Format the line from the original source code like node does

0 commit comments

Comments
 (0)