Robber inputs should be standalone and performs all the necessary tasks (including global assignments) at least after being passed into the function
So, for example, given this cop:
from random import uniform
def f(a):
return a == uniform(0,float('+inf'))
This Python class which is equal to anything is a valid input because it stands up to itself:
class Wildcard(object):
def __eq__(self, other):
return True
w = Wildcard()
print(f(w))
This JS snippet, however, is not:
Cop:
f=()=>1==2
Robber:
f=()=>2==2,f('foobar')
or:
Cop:
g=()=>false,f=()=>g()
Robber:
f((g=()=>true))
Because they have effects that occur before the cop function is even evaluated.
If they are performed after the control flow is passed inside the cop function, then it is okay. e.g:
Cop:
f=e=>{i=NaN;while(e!=i);return}
Robber:
f({valueOf:()=>(i=0,0)})
Strictly speaking, every action must be performed at least after the cop function is evaluated. So if the Robber's proposed solution is:
var i=0;
var e={toString:()=>['a','b','c','true'][i++]}
He should transform it so that everything is sit inside a variable:
var e={i:0, toString:()=>['a','b','c','true'][e.i++]}
which would allow one to call the cop solution directly like f(e)
.