Skip to content

Commit

Permalink
fix(ts): flawed boolean logic
Browse files Browse the repository at this point in the history
  • Loading branch information
LuLaValva authored Jan 9, 2025
1 parent 72deb96 commit b87f4b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .changeset/rude-peaches-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@marko/language-tools": patch
"@marko/language-server": patch
"@marko/type-check": patch
"marko-vscode": patch
---

Fix some flawed boolean logic
3 changes: 1 addition & 2 deletions packages/language-tools/src/extractors/script/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,11 +710,10 @@ constructor(_?: Return) {}
const def = tagName ? this.#lookup.getTag(tagName) : undefined;
const isHTML = def?.html;
const importPath = !isHTML && resolveTagImport(this.#filename, def);
const isMissing = def && !isHTML && !importPath;
let tagIdentifier: undefined | string;
let isTemplate = false;

if (!isHTML || !isMissing) {
if (!isHTML && (!def || importPath)) {
const tagId = this.#ensureTagId(tag);
tagIdentifier = varLocal("tag_" + tagId);
this.#extractor.write(`const ${tagIdentifier} = (\n`);
Expand Down

0 comments on commit b87f4b2

Please sign in to comment.