[js] test invalid params list string in function constructor - fix parsing and error handling code