similar to pull request 10 for node. this is the analog for java/rhino