From e7d150b332ec36a5122d3d200aa8fc591ae52a67 Mon Sep 17 00:00:00 2001 From: Nicolas Morel Date: Mon, 29 Aug 2016 18:33:55 +0200 Subject: [PATCH] Ignore sourcemaps names --- lib/fromStringWithSourceMap.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/fromStringWithSourceMap.js b/lib/fromStringWithSourceMap.js index cbddf99..0619db7 100644 --- a/lib/fromStringWithSourceMap.js +++ b/lib/fromStringWithSourceMap.js @@ -62,8 +62,9 @@ module.exports = function fromStringWithSourceMap(code, map) { var linePosition = currentLine; } - if(mapping.rest && mapping.rest[0] === ",") { - mapping.rest = mapping.rest.substr(1); + if(mapping.rest) { + var next = mapping.rest.indexOf(","); + mapping.rest = next === -1 ? "" : mapping.rest.substr(next); } if(!ignore) {