From 2888fa158d67c1419199f152326e12a05618b53e Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 28 Aug 2026 17:30:31 +0100 Subject: Create objects without prototypes when used as map with arbitrary keys --- lib/document-to-html.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/document-to-html.js') diff --git a/lib/document-to-html.js b/lib/document-to-html.js index bd750f0..19ef3b0 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -42,7 +42,7 @@ function DocumentConversion(options, comments) { function convertToHtml(document) { var messages = []; - var html = elementToHtml(document, messages, {}); + var html = elementToHtml(document, messages, Object.create(null)); var deferredNodes = []; walkHtml(html, function(node) { @@ -50,7 +50,7 @@ function DocumentConversion(options, comments) { deferredNodes.push(node); } }); - var deferredValues = {}; + var deferredValues = Object.create(null); return promises.mapSeries(deferredNodes, function(deferred) { return deferred.value().then(function(value) { deferredValues[deferred.id] = value; -- cgit v1.2.3