type check Javascript Object Literals in function parameters

see new tests added.