Cross-vm type checking utils for javascript