Validating JS function uses