Open the console and run testSpec(); and see the source of this file.

The promise code (no-topic version):
dojo.provide("dojox.Promise");	

dojox.Promise = function(){
		
	return {
		emit: function(data){ // stub function
		},
		 
		then: function(doneHandler,errHandler){
			var promise = new dojox.Promise();
			dojo.connect(this, 'emit', function(data){
				if(doneHandler && !(data instanceof Error)){
					var res = doneHandler(data);
					promise.emit(res);
				}
				if(errHandler && (data instanceof Error)){
					errHandler(data);
					promise.emit(data);
				}
			});
			return promise;
		}
	}
};

dojox.Promise.prototype.touched = 1;