Skip to content

Commit be580a0

Browse files
Remove unneeded methods declaration for old web browsers
1 parent 66c83ff commit be580a0

File tree

1 file changed

+0
-34
lines changed
  • src/librustdoc/html/static/js

1 file changed

+0
-34
lines changed

src/librustdoc/html/static/js/main.js

-34
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,6 @@
44

55
"use strict";
66

7-
if (!String.prototype.startsWith) {
8-
String.prototype.startsWith = function(searchString, position) {
9-
position = position || 0;
10-
return this.indexOf(searchString, position) === position;
11-
};
12-
}
13-
if (!String.prototype.endsWith) {
14-
String.prototype.endsWith = function(suffix, length) {
15-
const l = length || this.length;
16-
return this.indexOf(suffix, l - suffix.length) !== -1;
17-
};
18-
}
19-
20-
if (!DOMTokenList.prototype.add) {
21-
DOMTokenList.prototype.add = function(className) {
22-
if (className && !hasClass(this, className)) {
23-
if (this.className && this.className.length > 0) {
24-
this.className += " " + className;
25-
} else {
26-
this.className = className;
27-
}
28-
}
29-
};
30-
}
31-
32-
if (!DOMTokenList.prototype.remove) {
33-
DOMTokenList.prototype.remove = function(className) {
34-
if (className && this.className) {
35-
this.className = (" " + this.className + " ").replace(" " + className + " ", " ")
36-
.trim();
37-
}
38-
};
39-
}
40-
417
// Get a value from the rustdoc-vars div, which is used to convey data from
428
// Rust to the JS. If there is no such element, return null.
439
function getVar(name) {

0 commit comments

Comments
 (0)