Static type inference for JavaScript