Open inneslu opened 3 months ago
Deprecated function should run it's alias, and not error. Deprecated message should appear in console.
Error is thrown; $.fn.datepicker.deprecated not a function
1.8 - however, issue is still present in latest version - if any methods use the deprecated message.
var datepicker = $.fn.datepicker.noConflict(); $.fn.bootstrapDP = datepicker; $('.datepicker').bootstrapDP({options}); $('.datepicker').bootstrapDP('remove');
Deprecated function is being assigned to datepicker:
$.fn.datepicker.deprecated = function(msg){ var console = window.console; if (console && console.warn) { console.warn('DEPRECATED: ' + msg); } };
No conflict is reverting the datepicker function:
$.fn.datepicker.noConflict = function(){ $.fn.datepicker = old; return this; };
Alias function is referring to datepicker - which has since been reverted (i.e. no deprecated function exists):
function alias(method, deprecationMsg){ return function(){ if (deprecationMsg !== undefined) { $.fn.datepicker.deprecated(deprecationMsg); } return this[method].apply(this, arguments); }; }
Expected behaviour
Deprecated function should run it's alias, and not error. Deprecated message should appear in console.
Actual behaviour
Error is thrown; $.fn.datepicker.deprecated not a function
Datepicker version used
1.8 - however, issue is still present in latest version - if any methods use the deprecated message.
Example code
Reason why issue is occuring
Deprecated function is being assigned to datepicker:
No conflict is reverting the datepicker function:
Alias function is referring to datepicker - which has since been reverted (i.e. no deprecated function exists):