mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-11 02:56:21 +00:00
Remove unneeded and falsy String.trim polyfill (#5066)
1. [it is not required anymore since ages](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Browser_compatibility) 2. If "this" is of type type "object", an instance of the same type is returned. [This is completely wrong, because it should be "string"](https://tc39.es/ecma262/#sec-string.prototype.trim), which causes things like [sorting in BootstrapVue tables to break](https://github.com/jenkinsci/dependency-track-plugin/blob/cc5f1bb8900f201384f05b633471dbd7ca48c69a/src/main/webapp/js/result-action.js#L6).
This commit is contained in:
1 parent
09a643b1cf
commit
31d1ff2ad1
1 file changed
-14
@@ -2775,20 +2775,6 @@ var toggleCheckboxes = function(toggle) {
|
||||
}
|
||||
};
|
||||
|
||||
// this used to be in prototype.js but it must have been removed somewhere between 1.4.0 to 1.5.1
|
||||
String.prototype.trim = function() {
|
||||
var temp = this;
|
||||
var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
|
||||
if (obj.test(temp))
|
||||
temp = temp.replace(obj, '$2');
|
||||
obj = / /g;
|
||||
while (temp.match(obj))
|
||||
temp = temp.replace(obj, " ");
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var hoverNotification = (function() {
|
||||
var msgBox;
|
||||
var body;
|
||||
|
||||
Reference in new issue
Block a user