An effect system for JavaScript