Skip to content

Commit 8a7cf7d

Browse files
committed
fix(util): making some polyfills polyfills
1 parent 940e46a commit 8a7cf7d

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/js/modules/infragistics.util.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3769,8 +3769,10 @@
37693769
return ret;
37703770
});
37713771

3772-
String.prototype.startsWith = function (s) {
3773-
return this.indexOf(s) === 0;
3772+
if (!String.prototype.startsWith) {
3773+
String.prototype.startsWith = function (s) {
3774+
return this.indexOf(s) === 0;
3775+
}
37743776
};
37753777

37763778
String.prototype.startsWith1 = function (s, comparisonType) {
@@ -3781,12 +3783,14 @@
37813783
return $.ig.util.stringCompare1(this.slice(0, s.length), s, comparisonType || 0) === 0;
37823784
};
37833785

3784-
String.prototype.endsWith = function (s, comparisonType) {
3785-
if (this.length < s.length) {
3786-
return false;
3787-
}
3786+
if (!String.prototype.endsWith) {
3787+
String.prototype.endsWith = function (s, comparisonType) {
3788+
if (this.length < s.length) {
3789+
return false;
3790+
}
37883791

3789-
return $.ig.util.stringCompare1(this.slice(-s.length), s, comparisonType || 0) === 0;
3792+
return $.ig.util.stringCompare1(this.slice(-s.length), s, comparisonType || 0) === 0;
3793+
}
37903794
};
37913795

37923796
String.prototype.remove = function (index, count) {

0 commit comments

Comments
 (0)