diff --git a/lib/extractors/exported.js b/lib/extractors/exported.js index b569a7441..c400e49e4 100644 --- a/lib/extractors/exported.js +++ b/lib/extractors/exported.js @@ -28,7 +28,7 @@ function walkExported( ) { var newResults = []; var filename = data.file; - var dataCache = Object.create(null); + var dataCache = new Map(); function addBlankComment(data, path, node) { return addComment(data, '', node.loc, path, node.loc, true); @@ -178,7 +178,7 @@ function getCachedData(dataCache, filePath) { path = require.resolve(path); } - var value = dataCache[path]; + var value = dataCache.get(path); if (!value) { var input = fs.readFileSync(path, 'utf-8'); var ast = parseToAst(input, path); @@ -189,7 +189,7 @@ function getCachedData(dataCache, filePath) { }, ast }; - dataCache[path] = value; + dataCache.set(path, value); } return value; }