mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
Rollup merge of #96993 - notriddle:notriddle/prototype, r=GuillaumeGomez
rustdoc: fix GUI crash when searching for magic JS property values
This commit is contained in:
commit
5a111dff3b
@ -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