Skip to content

Commit

Permalink
fix: prevent selection compilers from side effecting selection defs
Browse files Browse the repository at this point in the history
  • Loading branch information
arvind committed Jun 13, 2022
1 parent 458cfc7 commit a4d4d32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compile/selection/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ export function parseUnitSelection(model: UnitModel, selDefs: SelectionParameter
events: isString(defaults.on) ? parseSelector(defaults.on, 'scope') : array(duplicate(defaults.on))
} as any);

const def_ = duplicate(def); // defensive copy to prevent compilers from causing side effects
for (const c of selectionCompilers) {
if (c.defined(selCmpt) && c.parse) {
c.parse(model, selCmpt, def);
c.parse(model, selCmpt, def_);
}
}
}
Expand Down

0 comments on commit a4d4d32

Please sign in to comment.