Type-checking for JavaScript