We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 39b6f45 + 028a313 commit b377babCopy full SHA for b377bab
src/librustdoc/html/render/write_shared.rs
@@ -328,8 +328,8 @@ pub(super) fn write_shared(
328
v.push_str(
329
r#"\
330
]'));
331
-if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
332
-if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
+if (typeof exports !== 'undefined') exports.searchIndex = searchIndex;
+else if (window.initSearch) window.initSearch(searchIndex);
333
"#,
334
);
335
Ok(v.into_bytes())
0 commit comments