Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
Short circuit conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
chloe authored Apr 15, 2021
1 parent 64ad5b1 commit c4054c0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export const isListRenderScope = (el: HTMLElement): boolean => {
};

export const isUnderListRenderScope = (el: HTMLElement): boolean => {
if (!el.parentElement) return false;
return el.parentElement.hasAttribute(`${DIRECTIVE_PREFIX}for`);
return el.parentElement && el.parentElement.hasAttribute(`${DIRECTIVE_PREFIX}for`);
};

export const createASTNode = (el: HTMLElement, state: State): ASTNode | undefined => {
Expand Down

0 comments on commit c4054c0

Please sign in to comment.