Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ES5 errors (IE11) #82145

Merged
merged 1 commit into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2908,10 +2908,14 @@ function defocusSearchBar() {
["⏎", "Go to active search result"],
["+", "Expand all sections"],
["-", "Collapse all sections"],
].map(x => "<dt>" +
x[0].split(" ")
.map((y, index) => (index & 1) === 0 ? "<kbd>" + y + "</kbd>" : " " + y + " ")
.join("") + "</dt><dd>" + x[1] + "</dd>").join("");
].map(function(x) {
return "<dt>" +
x[0].split(" ")
.map(function(y, index) {
return (index & 1) === 0 ? "<kbd>" + y + "</kbd>" : " " + y + " ";
})
.join("") + "</dt><dd>" + x[1] + "</dd>";
}).join("");
var div_shortcuts = document.createElement("div");
addClass(div_shortcuts, "shortcuts");
div_shortcuts.innerHTML = "<h2>Keyboard Shortcuts</h2><dl>" + shortcuts + "</dl></div>";
Expand All @@ -2929,7 +2933,9 @@ function defocusSearchBar() {
"You can look for items with an exact name by putting double quotes around \
your request: <code>\"string\"</code>",
"Look for items inside another one by searching for a path: <code>vec::Vec</code>",
].map(x => "<p>" + x + "</p>").join("");
].map(function(x) {
return "<p>" + x + "</p>";
}).join("");
var div_infos = document.createElement("div");
addClass(div_infos, "infos");
div_infos.innerHTML = "<h2>Search Tricks</h2>" + infos;
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ var updateSystemTheme = (function() {
if (!window.matchMedia) {
// fallback to the CSS computed value
return function() {
let cssTheme = getComputedStyle(document.documentElement)
var cssTheme = getComputedStyle(document.documentElement)
.getPropertyValue('content');

switchTheme(
Expand Down