ext/curl/curl.js
function CurlApi (ids, callback, errback, waitFor) {
		var then, ctx;
		ctx = core.createContext(userCfg, undef, [].concat(ids));
		this['then'] = then = function (resolved, rejected) {
			when(ctx,
				// return the dependencies as arguments, not an array
				function (deps) {
					if (resolved) resolved.apply(undef, deps);
				},
				// just throw if the dev didn't specify an error handler
				function (ex) {
					if (rejected) rejected(ex); else throw ex;
				}
			);
			return this;
		};
		this['next'] = function (ids, cb, eb) {
			// chain api
			return new CurlApi(ids, cb, eb, ctx);
		};
		this['config'] = _config;
		if (callback || errback) then(callback, errback);
		when(waitFor, function () { core.getDeps(ctx); });
	}
function CurlApi (ids, callback, errback, waitFor) {
		var then, ctx;
		ctx = core.createContext(userCfg, undef, [].concat(ids));
		this['then'] = then = function (resolved, rejected) {
			when(ctx,
				// return the dependencies as arguments, not an array
				function (deps) {
					if (resolved) resolved.apply(undef, deps);
				},
				// just throw if the dev didn't specify an error handler
				function (ex) {
					if (rejected) rejected(ex); else throw ex;
				}
			);
			return this;
		};
		this['next'] = function (ids, cb, eb) {
			// chain api
			return new CurlApi(ids, cb, eb, ctx);
		};
		this['config'] = _config;
		if (callback || errback) then(callback, errback);
		when(waitFor, function () { core.getDeps(ctx); });
	}
function CurlApi ( ids , callback , errback , waitFor ) { var then , ctx ; ctx = core . createContext ( userCfg , undef , [ ] . concat ( ids ) ) ; this [ 'then' ] = then = function ( resolved , rejected ) { when ( ctx , // return the dependencies as arguments, not an array function ( deps ) { if ( resolved ) resolved . apply ( undef , deps ) ; } , // just throw if the dev didn't specify an error handler function ( ex ) { if ( rejected ) rejected ( ex ) ; else throw ex ; } ) ; return this ; } ; this [ 'next' ] = function ( ids , cb , eb ) { // chain api return new CurlApi ( ids , cb , eb , ctx ) ; } ; this [ 'config' ] = _config ; if ( callback || errback ) then ( callback , errback ) ; when ( waitFor , function ( ) { core . getDeps ( ctx ) ; } ) ; }
thanks to Joop Ringelberg for helping troubleshoot the API
thanks to Joop Ringelberg for helping troubleshoot the API