Type Refinement for Static Analysis of JavaScript