I've just filed a bug with ajax context which, in a nutshell, is that a clone of the context object is passed into the callbacks rather than the object itself. This pretty much makes the object read-only.
Current code:
- ajax: function( origSettings ) {
- var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
- var jsonp, status, data,
- callbackContext = s.context || s,
Looking at this, it has just occurred to me that jQuery.ajax is unnecessarily deep cloning the context object, which is a big literal object "namespace".
Isn't this a potential scaling problem; since the need for context correlates with the context object's complexity? (bigger namespace => more need for context => more to extend => slower ajax calls).
Perhaps a better way to handle this is to remove the context property reference of origSettings while extend does it's work?