Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdecker committed Dec 28, 2016
1 parent 9999e1d commit 9f16aa7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source-map-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,13 @@ function getErrorSource(error) {
var contents = fileContentsCache[source];

// Support files on disk
if (!contents && fs.existsSync(source)) {
contents = fs.readFileSync(source, 'utf8');
try {
const fs = require('fs');
if (!contents && fs.existsSync(source)) {
contents = fs.readFileSync(source, 'utf8');
}
} catch (err) {
/* NOP */
}

// Format the line from the original source code like node does
Expand Down

0 comments on commit 9f16aa7

Please sign in to comment.