If that example chains to be JS the val
is incorrect. It should be var
, let
, or const
. It needs to be corrected.
There is a quirk in how scripts get reused in managed rules (i.e. the UI) where you can only use var
unless it’s inside a context (i.e. inside { }).