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 Apr 29, 2022
1 parent fb1010a commit 045358c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compile/selection/parse.ts
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 045358c

Please sign in to comment.