Skip to content

Commit

Permalink
Don't initialize inlineConfigComments with array
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Sep 27, 2024
1 parent 2021755 commit c3fe8e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/language/markdown-source-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class MarkdownSourceCode extends TextSourceCodeBase {
* Collection of inline configuration comments.
* @type {Array<InlineConfigComment>}
*/
#inlineConfigComments = [];
#inlineConfigComments;

/**
* The AST of the source code.
Expand Down Expand Up @@ -196,7 +196,7 @@ export class MarkdownSourceCode extends TextSourceCodeBase {
* @returns {Array<InlineConfigComment>} An array of all inline configuration nodes.
*/
getInlineConfigNodes() {
if (this.#inlineConfigComments.length === 0) {
if (!this.#inlineConfigComments) {
this.#inlineConfigComments = this.#htmlNodes.flatMap(
extractInlineConfigCommentsFromHTML,
);
Expand Down

0 comments on commit c3fe8e5

Please sign in to comment.