rustdoc: fix GUI crash when searching for magic JS property values
This commit is contained in:
parent
c6499fd998
commit
d3fd6bfd30
@ -119,7 +119,7 @@ window.initSearch = rawSearchIndex => {
|
||||
*/
|
||||
let searchIndex;
|
||||
let currentResults;
|
||||
const ALIASES = {};
|
||||
const ALIASES = Object.create(null);
|
||||
const params = searchState.getQueryStringParams();
|
||||
|
||||
// Populate search bar with query string search term when provided,
|
||||
@ -1953,7 +1953,7 @@ window.initSearch = rawSearchIndex => {
|
||||
}
|
||||
|
||||
if (aliases) {
|
||||
ALIASES[crate] = {};
|
||||
ALIASES[crate] = Object.create(null);
|
||||
for (const alias_name in aliases) {
|
||||
if (!hasOwnPropertyRustdoc(aliases, alias_name)) {
|
||||
continue;
|
||||
|
16
src/test/rustdoc-js/prototype.js
vendored
Normal file
16
src/test/rustdoc-js/prototype.js
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// exact-check
|
||||
|
||||
const QUERY = ['constructor', '__proto__'];
|
||||
|
||||
const EXPECTED = [
|
||||
{
|
||||
'others': [],
|
||||
'returned': [],
|
||||
'in_args': [],
|
||||
},
|
||||
{
|
||||
'others': [],
|
||||
'returned': [],
|
||||
'in_args': [],
|
||||
},
|
||||
];
|
4
src/test/rustdoc-js/prototype.rs
Normal file
4
src/test/rustdoc-js/prototype.rs
Normal file
@ -0,0 +1,4 @@
|
||||
// The alias needed to be there to reproduce the bug
|
||||
// that used to be here.
|
||||
#[doc(alias="other_alias")]
|
||||
pub fn something_else() {}
|
Loading…
Reference in New Issue
Block a user