The search.js Javascript in javadoc needs to be rearranges so that its easier to test Javascript functions.
Comments
JDK-8220497 introduced functional tests for the search script. Unfortunately, with the removal of the Nashorn JS engine, these tests are skipped by default and require a JS script engine such as GraalJS in order to run. However, there is no need to update the search script in order to facilitate testing.