A pattern-matching compiler for JavaScript