From 63cfb82ca7b6366a3e9da7fd84383805a4c19bc5 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 5 Oct 2015 16:34:40 +0100 Subject: [PATCH] clean up mergeSourceMap method - closes #2479 --- packages/babel-core/src/transformation/file/index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/babel-core/src/transformation/file/index.js b/packages/babel-core/src/transformation/file/index.js index e6c69ca1cd..731f62c5a8 100644 --- a/packages/babel-core/src/transformation/file/index.js +++ b/packages/babel-core/src/transformation/file/index.js @@ -417,13 +417,9 @@ export default class File extends Store { } mergeSourceMap(map: Object) { - let opts = this.opts; - - let inputMap = opts.inputSourceMap; + let inputMap = this.opts.inputSourceMap; if (inputMap) { - map.sources[0] = inputMap.file; - let inputMapConsumer = new sourceMap.SourceMapConsumer(inputMap); let outputMapConsumer = new sourceMap.SourceMapConsumer(map); let outputMapGenerator = sourceMap.SourceMapGenerator.fromSourceMap(outputMapConsumer); @@ -433,9 +429,9 @@ export default class File extends Store { mergedMap.sources = inputMap.sources; mergedMap.file = inputMap.file; return mergedMap; + } else { + return map; } - - return map; } getModuleFormatter(type: string) {