Skip to content

Commit

Permalink
af651f6ab12052c1cb5d67cb73ad3284e2c296cb Fix: Add polyfill for Array.…
Browse files Browse the repository at this point in the history
…prototype.includes as we use it in extensions now and IE11 (which is still supported) does not have Array.prototype.includes

DD-2309

Sync to source repo @af651f6ab12052c1cb5d67cb73ad3284e2c296cb
  • Loading branch information
AllanJard committed Sep 23, 2021
1 parent 59a8d3f commit c12b06c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 42 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "1.11.2",
"last-sync": "e835ddc5b800c47f7e9e32a91cc522f8ca7ced5c"
"last-sync": "af651f6ab12052c1cb5d67cb73ad3284e2c296cb"
}
10 changes: 10 additions & 0 deletions js/jquery.dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,16 @@
};
}

if (! Array.prototype.includes) {
Array.prototype.includes = function (search, start) {
if (start === undefined) {
start = 0;
}

return this.indexOf(search, start) !== -1;
};
}

// .trim() polyfill
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim
if (!String.prototype.trim) {
Expand Down
Loading

0 comments on commit c12b06c

Please sign in to comment.