From 49c1501f8277f344dee0a56da640a93c67744663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20L=C3=B3pez?= Date: Tue, 20 Mar 2018 09:36:33 +0100 Subject: [PATCH] =?UTF-8?q?Add=20`SourceNode.fromStringWithSourceMap=C2=B4?= =?UTF-8?q?=20to=20`source-map`=20benchmark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #43. --- src/source-map-benchmark.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/source-map-benchmark.js b/src/source-map-benchmark.js index e5b31605..29509517 100644 --- a/src/source-map-benchmark.js +++ b/src/source-map-benchmark.js @@ -20,7 +20,11 @@ module.exports = { const smc = new sourceMap.SourceMapConsumer(payload); // ...then serialize the parsed source map to a String. const smg = sourceMap.SourceMapGenerator.fromSourceMap(smc); - return smg.toString(); + + // Create a SourceNode from the generated code and a SourceMapConsumer. + const fswsm = sourceMap.SourceNode.fromStringWithSourceMap(payload, smc); + + return [smg.toString(), fswsm.toString()]; }); } };