Skip to content

Commit

Permalink
c1fb50aa929c0eccf8c2f1722feb7af141389b7c Fix: Change where the name o…
Browse files Browse the repository at this point in the history
…f the data type detection function is stored as old Safari didn't allow dynamic changes of a function name

https://datatables.net/forums/discussion/79829/

Sync to source repo @c1fb50aa929c0eccf8c2f1722feb7af141389b7c
  • Loading branch information
dtbuild committed Sep 16, 2024
1 parent 59277de commit 11742c3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "2.1.6",
"last-sync": "fdc8a7fe754ee1d45685dfa9382355a8f34bf111"
"last-sync": "c1fb50aa929c0eccf8c2f1722feb7af141389b7c"
}
10 changes: 5 additions & 5 deletions js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -2254,7 +2254,7 @@
*/
function _typeResult (typeDetect, res) {
return res === true
? typeDetect.name
? typeDetect._name
: res;
}

Expand Down Expand Up @@ -12418,7 +12418,7 @@
return {
className: _extTypes.className[name],
detect: _extTypes.detect.find(function (fn) {
return fn.name === name;
return fn._name === name;
}),
order: {
pre: _extTypes.order[name + '-pre'],
Expand All @@ -12436,10 +12436,10 @@
var setDetect = function (detect) {
// `detect` can be a function or an object - we set a name
// property for either - that is used for the detection
Object.defineProperty(detect, "name", {value: name});
Object.defineProperty(detect, "_name", {value: name});

var idx = _extTypes.detect.findIndex(function (item) {
return item.name === name;
return item._name === name;
});

if (idx === -1) {
Expand Down Expand Up @@ -12502,7 +12502,7 @@
// Get a list of types
DataTable.types = function () {
return _extTypes.detect.map(function (fn) {
return fn.name;
return fn._name;
});
};

Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.min.mjs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2201,7 +2201,7 @@ function _fnGetColumns( oSettings, sParam )
*/
function _typeResult (typeDetect, res) {
return res === true
? typeDetect.name
? typeDetect._name
: res;
}

Expand Down Expand Up @@ -12365,7 +12365,7 @@ DataTable.type = function (name, prop, val) {
return {
className: _extTypes.className[name],
detect: _extTypes.detect.find(function (fn) {
return fn.name === name;
return fn._name === name;
}),
order: {
pre: _extTypes.order[name + '-pre'],
Expand All @@ -12383,10 +12383,10 @@ DataTable.type = function (name, prop, val) {
var setDetect = function (detect) {
// `detect` can be a function or an object - we set a name
// property for either - that is used for the detection
Object.defineProperty(detect, "name", {value: name});
Object.defineProperty(detect, "_name", {value: name});

var idx = _extTypes.detect.findIndex(function (item) {
return item.name === name;
return item._name === name;
});

if (idx === -1) {
Expand Down Expand Up @@ -12449,7 +12449,7 @@ DataTable.type = function (name, prop, val) {
// Get a list of types
DataTable.types = function () {
return _extTypes.detect.map(function (fn) {
return fn.name;
return fn._name;
});
};

Expand Down

0 comments on commit 11742c3

Please sign in to comment.