Fix generation of JS code for pattern matching on literals