FIX: Polyfill String.startsWith function for IE11
Followup to fe0d912b97
This commit is contained in:
parent
d294e13225
commit
b34f09f8d7
|
@ -321,6 +321,16 @@ if (!String.prototype.repeat) {
|
|||
};
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#Polyfill
|
||||
if (!String.prototype.startsWith) {
|
||||
Object.defineProperty(String.prototype, "startsWith", {
|
||||
value: function(search, rawPos) {
|
||||
var pos = rawPos > 0 ? rawPos | 0 : 0;
|
||||
return this.substring(pos, pos + search.length) === search;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*!
|
||||
* Symbol-ES6 v0.1.2
|
||||
* ES6 Symbol polyfill in pure ES5.
|
||||
|
|
Loading…
Reference in New Issue