Skip to content

Commit 13f18cd

Browse files
Rollup merge of rust-lang#82145 - GuillaumeGomez:es5-checks, r=Nemo157
ES5 checks rustdoc is supposed to run on IE11 but someone reported me that it wasn't. I just confirmed it by using `es-check` with the `es5` option like this: ``` $ es-check es5 src/librustdoc/html/static/*.js ``` The PR fixes those issues and add CI checks to prevent regressions. `@Mark-Simulacrum:` I added checks in the CI, but not sure if it's the correct way to do it. Any help on that side would be very appreciated! r? `@Nemo157`
2 parents f1c47c7 + 719c8d4 commit 13f18cd

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/librustdoc/html/static/main.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -2908,10 +2908,14 @@ function defocusSearchBar() {
29082908
["⏎", "Go to active search result"],
29092909
["+", "Expand all sections"],
29102910
["-", "Collapse all sections"],
2911-
].map(x => "<dt>" +
2912-
x[0].split(" ")
2913-
.map((y, index) => (index & 1) === 0 ? "<kbd>" + y + "</kbd>" : " " + y + " ")
2914-
.join("") + "</dt><dd>" + x[1] + "</dd>").join("");
2911+
].map(function(x) {
2912+
return "<dt>" +
2913+
x[0].split(" ")
2914+
.map(function(y, index) {
2915+
return (index & 1) === 0 ? "<kbd>" + y + "</kbd>" : " " + y + " ";
2916+
})
2917+
.join("") + "</dt><dd>" + x[1] + "</dd>";
2918+
}).join("");
29152919
var div_shortcuts = document.createElement("div");
29162920
addClass(div_shortcuts, "shortcuts");
29172921
div_shortcuts.innerHTML = "<h2>Keyboard Shortcuts</h2><dl>" + shortcuts + "</dl></div>";
@@ -2929,7 +2933,9 @@ function defocusSearchBar() {
29292933
"You can look for items with an exact name by putting double quotes around \
29302934
your request: <code>\"string\"</code>",
29312935
"Look for items inside another one by searching for a path: <code>vec::Vec</code>",
2932-
].map(x => "<p>" + x + "</p>").join("");
2936+
].map(function(x) {
2937+
return "<p>" + x + "</p>";
2938+
}).join("");
29332939
var div_infos = document.createElement("div");
29342940
addClass(div_infos, "infos");
29352941
div_infos.innerHTML = "<h2>Search Tricks</h2>" + infos;

src/librustdoc/html/static/storage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ var updateSystemTheme = (function() {
157157
if (!window.matchMedia) {
158158
// fallback to the CSS computed value
159159
return function() {
160-
let cssTheme = getComputedStyle(document.documentElement)
160+
var cssTheme = getComputedStyle(document.documentElement)
161161
.getPropertyValue('content');
162162

163163
switchTheme(

0 commit comments

Comments
 (0)