Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti authored Feb 24, 2025
1 parent a5d694b commit a482899
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export function processInstanceScriptContent(
let scope = new Scope();
const rootScope = scope;

//track is the variable declared as `props` comes from `$props()`
let isPropsDeclarationRune = false;

const pushScope = () => (scope = new Scope(scope));
Expand Down Expand Up @@ -130,6 +131,7 @@ export function processInstanceScriptContent(
return;
}

//if we are in a variable declaration and the identifier is `props` we check the initializer
if (
ident.text === 'props' &&
variableDeclarationNode &&
Expand Down Expand Up @@ -327,6 +329,7 @@ export function processInstanceScriptContent(

//resolve stores
if (isPropsDeclarationRune) {
//we filter out every pendingStore resolution that `isPropsId` if the variable names `props` comes from `$props()`
pendingStoreResolutions = pendingStoreResolutions.filter(({ isPropsId }) => !isPropsId);
}
pendingStoreResolutions.map(resolveStore);
Expand Down

0 comments on commit a482899

Please sign in to comment.