mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 09:38:26 +03:00
typecheck window.NOTABLE_TRAITS
This commit is contained in:
@@ -1327,11 +1327,9 @@ function preLoadCss(cssUrl) {
|
||||
*/
|
||||
function showTooltip(e) {
|
||||
const notable_ty = e.getAttribute("data-notable-ty");
|
||||
// @ts-expect-error
|
||||
if (!window.NOTABLE_TRAITS && notable_ty) {
|
||||
const data = document.getElementById("notable-traits-data");
|
||||
if (data) {
|
||||
// @ts-expect-error
|
||||
window.NOTABLE_TRAITS = JSON.parse(data.innerText);
|
||||
} else {
|
||||
throw new Error("showTooltip() called with notable without any notable traits!");
|
||||
|
||||
+2
@@ -28,6 +28,8 @@ declare global {
|
||||
currentTheme: HTMLLinkElement|null;
|
||||
/** Generated in `render/context.rs` */
|
||||
SIDEBAR_ITEMS?: { [key: string]: string[] };
|
||||
/** Notable trait data */
|
||||
NOTABLE_TRAITS?: { [key: string]: string };
|
||||
/** Used by the popover tooltip code. */
|
||||
RUSTDOC_TOOLTIP_HOVER_MS: number;
|
||||
/** Used by the popover tooltip code. */
|
||||
|
||||
Reference in New Issue
Block a user