Type-checking for Javascript