Translate to javascript using rhino.