Prior to v 1.5 jQuery's ajaxSetup used a shallow copy of settings like: jQuery.extend( jQuery.ajaxSettings, settings );
Beginning from 1.5 it is doing a deep copy like: target = jQuery.extend(true, jQuery.ajaxSettings, settings );
The problem is that it deep copies everything that exists in the settings including the context which may be way to much - for example if you want a context to be a document itself, then deep copy will duplicate an entire document. Another issue with the deep copy could be circular rererences if I pass an object that has a child object with for example a "parent" property pointing back to an original object. Then javascript will run out of the stack space and throw an error.
For example:
var _parent = {someProp: "parent"};
var _child = {someProp: "child", parent: _parent};
_parent.child = _child;
Pass this as a context and there will be out of stack space error.
So why did jQuery 1.5 started doing a deep copy instead of a regular copy?
Thank you
Roman