JS: generalize `BarrierGuardFunction`to work on function that have multiple parameters
old-change-notes