See the Rhino JavaScript API for cucumber-rhino.