From 0e6de2c31dbf8c21277481f112e99c52b913940f Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 27 Dec 2017 19:33:54 +0100 Subject: node_modules --- node_modules/source-map-support/source-map-support.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'node_modules/source-map-support/source-map-support.js') diff --git a/node_modules/source-map-support/source-map-support.js b/node_modules/source-map-support/source-map-support.js index dca92bcbe..abd888604 100644 --- a/node_modules/source-map-support/source-map-support.js +++ b/node_modules/source-map-support/source-map-support.js @@ -80,7 +80,11 @@ retrieveFileHandlers.push(function(path) { } } else if (fs.existsSync(path)) { // Otherwise, use the filesystem - contents = fs.readFileSync(path, 'utf8'); + try { + contents = fs.readFileSync(path, 'utf8'); + } catch (er) { + contents = ''; + } } return fileContentsCache[path] = contents; @@ -331,8 +335,9 @@ function wrapCallSite(frame) { // Fix position in Node where some (internal) code is prepended. // See https://github.com/evanw/node-source-map-support/issues/36 - if (line === 1 && !isInBrowser() && !frame.isEval()) { - column -= 62; + var headerLength = 62; + if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) { + column -= headerLength; } var position = mapSourcePosition({ @@ -387,7 +392,11 @@ function getErrorSource(error) { // Support files on disk if (!contents && fs && fs.existsSync(source)) { - contents = fs.readFileSync(source, 'utf8'); + try { + contents = fs.readFileSync(source, 'utf8'); + } catch (er) { + contents = ''; + } } // Format the line from the original source code like node does -- cgit v1.2.3