QPID-5723: fix JavaScript issues to enable evaluation under the new engine in JDK 8

merge from trunk r1590256


git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.28@1591690 13f79535-47bb-0310-9956-ffa450edef68