[ JS ] Fix pattern-matching on record constructors