From 78af16ee3545812ffa40648316eddf8437c97a6b Mon Sep 17 00:00:00 2001 From: oguimbal Date: Mon, 6 Jan 2020 14:16:58 +0100 Subject: [PATCH] Expose emptyCache() function --- source-map-support.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source-map-support.js b/source-map-support.js index 1561cee..2f80ace 100644 --- a/source-map-support.js +++ b/source-map-support.js @@ -398,12 +398,16 @@ function wrapCallSite(frame, state) { return frame; } +function emptyCache() { + fileContentsCache = {}; + sourceMapCache = {}; +} + // This function is part of the V8 stack trace API, for more info see: // https://v8.dev/docs/stack-trace-api function prepareStackTrace(error, stack) { if (emptyCacheBetweenOperations) { - fileContentsCache = {}; - sourceMapCache = {}; + emptyCache(); } var name = error.name || 'Error'; @@ -585,3 +589,5 @@ exports.resetRetrieveHandlers = function() { retrieveSourceMap = handlerExec(retrieveMapHandlers); retrieveFile = handlerExec(retrieveFileHandlers); } + +exports.emptyCache = emptyCache; \ No newline at end of file