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:
parent
29e972dc60
commit
453979462a
4 changed files with 117 additions and 313 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue