Use consistent way to check js param type.
Fix coding style.