1
Fork 0

rustdoc: make search.js a module

Previously, search.js relied on the DOM and the `window` object. It can now be
loaded in the absence of the DOM, for instance by Node. The same is true of
search-index.js.

This allows removing a lot of code from src/tools/rustdoc-js/tester.js that
tried to parse search.js and extract specific functions that were needed for
testing.
This commit is contained in:
Jacob Hoffman-Andrews 2022-05-15 21:09:55 -07:00
parent 29e972dc60
commit 453979462a
4 changed files with 117 additions and 313 deletions

View file

@ -100,11 +100,6 @@ function onEachLazy(lazyArray, func, reversed) {
reversed);
}
// eslint-disable-next-line no-unused-vars
function hasOwnPropertyRustdoc(obj, property) {
return Object.prototype.hasOwnProperty.call(obj, property);
}
function updateLocalStorage(name, value) {
try {
window.localStorage.setItem("rustdoc-" + name, value);