define([
	'exports',
	'../errors/RequestError',
	'../errors/CancelError',
	'../Deferred',
	'../io-query',
	'../lang'
], function (exports, RequestError, CancelError, Deferred, ioQuery, lang) {
	'use strict';

	exports.deepCopy = function deepCopy(target, source) {
		for (var name in source) {
			var tval = target[name],
				sval = source[name];
			if (tval !== sval) {
				if (tval && typeof tval === 'object' && sval && typeof sval === 'object') {
					exports.deepCopy(tval, sval);
				}
				else {
					target[name] = sval;
				}
			}
		}
		return target;
	};

	exports.deepCreate = function deepCreate(source, properties) {
		properties = properties || {};
		var target = lang.delegate(source),
			name, value;

		for (name in source) {
			value = source[name];

			if (value && typeof value === 'object') {
				target[name] = exports.deepCreate(value, properties[name]);
			}
		}
		return exports.deepCopy(target, properties);
	};

	var freeze = Object.freeze || function (obj) { return obj; };
	function okHandler(response) {
		return freeze(response);
	}
	function dataHandler(response) {
		return response.data || response.text;
	}

	exports.deferred = function deferred(response, cancel, isValid, isReady, handleResponse, last) {
		var def = new Deferred(function (reason) {
			cancel && cancel(def, response);

			if (!reason || !(reason instanceof RequestError) && !(reason instanceof CancelError)) {
				return new CancelError('Request canceled', response);
			}
			return reason;
		});

		def.response = response;
		def.isValid = isValid;
		def.isReady = isReady;
		def.handleResponse = handleResponse;

		function errHandler(error) {
			error.response = response;
			throw error;
		}
		var responsePromise = def.then(okHandler).then(null, errHandler);

		if (exports.notify) {
			responsePromise.then(
				lang.hitch(exports.notify, 'emit', 'load'),
				lang.hitch(exports.notify, 'emit', 'error')
			);
		}

		var dataPromise = responsePromise.then(dataHandler);

		// http://bugs.dojotoolkit.org/ticket/16794
		// The following works around a leak in IE9 through the
		// prototype using lang.delegate on dataPromise and
		// assigning the result a property with a reference to
		// responsePromise.
		/* global Promise */
		var promise = new Promise();
		for (var prop in dataPromise) {
			if (Object.hasOwnProperty(dataPromise, prop)) {
				promise[prop] = dataPromise[prop];
			}
		}
		promise.response = responsePromise;
		freeze(promise);
		// End leak fix


		if (last) {
			def.then(function (response) {
				last.call(def, response);
			}, function (error) {
				last.call(def, response, error);
			});
		}

		def.promise = promise;
		def.then = promise.then;

		return def;
	};

	exports.addCommonMethods = function addCommonMethods(provider, methods) {
		(methods || ['GET', 'POST', 'PUT', 'DELETE']).forEach(function (method) {
			provider[(method === 'DELETE' ? 'DEL' : method).toLowerCase()] = function (url, options) {
				options = lang.delegate(options || {});
				options.method = method;
				return provider(url, options);
			};
		});
	};

	exports.parseArgs = function parseArgs(url, options, skipData) {
		var data = options.data,
			query = options.query;

		if (data && !skipData) {
			if (typeof data === 'object') {
				options.data = ioQuery.objectToQuery(data);
			}
		}

		if (query) {
			if (typeof query === 'object') {
				query = ioQuery.objectToQuery(query);
			}
			if (options.preventCache) {
				query += (query ? '&' : '') + 'request.preventCache=' + (+(new Date()));
			}
		}
		else if (options.preventCache) {
			query = 'request.preventCache=' + (+(new Date()));
		}

		if (url && query) {
			url += (~url.indexOf('?') ? '&' : '?') + query;
		}

		return {
			url: url,
			options: options,
			getHeader: function (/*headerName*/) { return null; }
		};
	};

	exports.checkStatus = function (stat) {
		stat = stat || 0;
		return (stat >= 200 && stat < 300) || // allow any 2XX response code
			stat === 304 ||                 // or, get it out of the cache
			stat === 1223 ||                // or, Internet Explorer mangled the status code
			!stat;                         // or, we're Titanium/browser chrome/chrome extension requesting a local file
	};
});

@@ -2271,21 +2271,16 @@
 ;%0A%09%09
-for (
 var prop
  in 
@@ -2279,79 +2279,81 @@
 prop
- in dataPromise) %7B%0A%09%09%09if (Object.hasOwnProperty(dataPromise, prop)
+s = Object.keys(dataPromise);%0A%09%09for (var i = 0; i %3C props.length; i++
 ) %7B%0A
-%09
 %09%09%09p
@@ -2363,16 +2363,20 @@
 ise%5Bprop
+s%5Bi%5D
 %5D = data
@@ -2391,15 +2391,14 @@
 prop
-%5D;%0A%09%09%09%7D
+s%5Bi%5D%5D;
 %0A%09%09%7D

Modify request/util to work with Promise polyfill