diff --git a/src/main/parser.js b/src/main/parser.js index 644948b94..fdff76264 100644 --- a/src/main/parser.js +++ b/src/main/parser.js @@ -57,7 +57,11 @@ function callPluginParseFunction(originalText, opts) { const parsers = getParsers(opts); // Create a new object {parserName: parseFn}. Uses defineProperty() to only call + // the parsers getters when actually calling the parser `parse` function. const parsersForCustomParserApi = Object.defineProperties( + {}, + Object.fromEntries( + Object.keys(parsers).map((parserName) => [ parserName, { enumerable: true,