From c3fe8e56e7b92e17af07eda549655d90473722a5 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Fri, 27 Sep 2024 10:34:16 -0400 Subject: [PATCH] Don't initialize inlineConfigComments with array --- src/language/markdown-source-code.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/language/markdown-source-code.js b/src/language/markdown-source-code.js index 7ff11a8..978fe96 100644 --- a/src/language/markdown-source-code.js +++ b/src/language/markdown-source-code.js @@ -159,7 +159,7 @@ export class MarkdownSourceCode extends TextSourceCodeBase { * Collection of inline configuration comments. * @type {Array} */ - #inlineConfigComments = []; + #inlineConfigComments; /** * The AST of the source code. @@ -196,7 +196,7 @@ export class MarkdownSourceCode extends TextSourceCodeBase { * @returns {Array} An array of all inline configuration nodes. */ getInlineConfigNodes() { - if (this.#inlineConfigComments.length === 0) { + if (!this.#inlineConfigComments) { this.#inlineConfigComments = this.#htmlNodes.flatMap( extractInlineConfigCommentsFromHTML, );