[js] test invalid parameters on function constructor call