Skip to content

Commit

Permalink
Merge pull request #24 from tfso/bugfix/scope-for-lambda
Browse files Browse the repository at this point in the history
bugfix/Scope for lambda
  • Loading branch information
lostfields authored Apr 30, 2024
2 parents 95a4e8b + 24d2fda commit b618416
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/linq/peg/reducervisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ export class ReducerVisitor extends ExpressionVisitor {
if(isRecord(scope))
Object.assign(newScope, { [scopeName]: scope })
}
else {
Object.assign(newScope, scope ?? {})
}

let result = this.evaluate((<ILambdaExpression>expression).expression, newScope, Object.assign({}, global, newScope))

Expand Down

0 comments on commit b618416

Please sign in to comment.