update jsdeferred

This commit is contained in:
Piro / SHIMODA Hiroshi 2011-02-28 23:09:15 +09:00
parent 41eb5685b2
commit fda2d6e4cc

View File

@ -1,20 +1,17 @@
// Usage:: Components.utils.import('..../jsdeferred.jscodemodule.js'); // Usage:: Components.utils.import('..../jsdeferred.jscodemodule.js');
// JSDeferred 0.3.4 Copyright (c) 2007 cho45 ( www.lowreal.net ) // JSDeferred 0.3.4 Copyright (c) 2007 cho45 ( www.lowreal.net )
// See http://github.com/cho45/jsdeferred // See http://github.com/cho45/jsdeferred
var EXPORTED_SYMBOLS = ['Deferred']; var EXPORTED_SYMBOLS = ["Deferred"];
var window = {};
var location = { protocol: 'resource:' };
var document = { addEventListener : function() {} };
function setTimeout(aCallback, aDelay) { function setTimeout (f, i) {
var timer = Components.classes['@mozilla.org/timer;1'] let timer = Components.classes["@mozilla.org/timer;1"]
.createInstance(Components.interfaces.nsITimer); .createInstance(Components.interfaces.nsITimer);
timer.initWithCallback(aCallback, aDelay, timer.TYPE_ONE_SHOT); timer.initWithCallback(f, i, timer.TYPE_ONE_SHOT);
return timer; return timer;
} }
function clearTimeout(aTimer) { function clearTimeout (timer) {
aTimer.cancel(); timer.cancel();
} }
@ -373,4 +370,4 @@ Deferred.define = function (obj, list) {
return Deferred; return Deferred;
}; };
this.Deferred = Deferred;// End of JSDeferred this.Deferred = Deferred;