All pastes #508429 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-25 00:29 UTC
rendered paste body
function XPropCache ()
{
    this._fillers = new Object ();
}
XPropCache.prototype = {
    Add : function (atom, filler) {
	this._fillers[atom] = filler;
	this.Invalidate (atom);
    },

    Invalidate: function (atom) {
	this.__defineGetter__ (atom,
			       function () {
				   var prop_val = this._content.nativeWindow.GetProperty (atom);
				   var val = (prop_val == null) ? null : this._fillers[atom](prop_val);
				   this.__defineGetter__ (atom, function () { return val; });
				   return val;
			       });
    }
}