Low-level error in 1.9.4 _fnExtend?
Low-level error in 1.9.4 _fnExtend?
psmerd
Posts: 9Questions: 0Answers: 0
In using jquery.lint, it flagged _fnExtend as passing an invalid argument list to $.extend. Specifically, argument 2 is null.
The code in question is in datatables 1.9.4 around line 4772
.
[code]
if ( typeof oInit[prop] === 'object' && val !== null && $.isArray(val) === false )
{
$.extend( true, oOut[prop], val );
}
else
{
oOut[prop] = val;
}
[/code]
By inspection, it appears the test is incorrect: it should be checking typeof oOut[prop] === 'object' instead of checking oInit[prop]
When I changed the code from typeof oInit[prop] === 'object' to typeof oOut[prop] === 'object', the page did not appear to behave properly (nothing was emitted). When I changed the code to typeof oInit[prop] === 'object' && typeof oOut[prop] === 'object', the table appeared and the jquery.lint warning disappeared.
The code in question is in datatables 1.9.4 around line 4772
.
[code]
if ( typeof oInit[prop] === 'object' && val !== null && $.isArray(val) === false )
{
$.extend( true, oOut[prop], val );
}
else
{
oOut[prop] = val;
}
[/code]
By inspection, it appears the test is incorrect: it should be checking typeof oOut[prop] === 'object' instead of checking oInit[prop]
When I changed the code from typeof oInit[prop] === 'object' to typeof oOut[prop] === 'object', the page did not appear to behave properly (nothing was emitted). When I changed the code to typeof oInit[prop] === 'object' && typeof oOut[prop] === 'object', the table appeared and the jquery.lint warning disappeared.
This discussion has been closed.
Replies
Allan