Skip to content

Commit

Permalink
fix(shader-ast): fix if() handling in scopedChildren()
Browse files Browse the repository at this point in the history
- include test in returned children otherwise any referenced functions
  there will not be captured in dependencies
  • Loading branch information
postspectacular committed Oct 24, 2023
1 parent dc7eeab commit 64d23c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/shader-ast/src/ast/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export const scopedChildren = (t: Term<any>) =>
? (<Func<any>>t).scope.body
: t.tag === "if"
? (<Branch>t).f
? (<Branch>t).t.body.concat((<Branch>t).f!.body)
: (<Branch>t).t.body
? [(<Branch>t).test, ...(<Branch>t).t.body, ...(<Branch>t).f!.body]
: [(<Branch>t).test, ...(<Branch>t).t.body]
: undefined;

/**
Expand Down

0 comments on commit 64d23c0

Please sign in to comment.