Object.prototype.link

memolus at googlemail.com memolus at googlemail.com
Sat Feb 21 01:56:34 PST 2009


I'd like to see a feature in ECMAScript to link one object to another.

example implementation:
Object.prototype.link = function (prop, target, tprop) {
    this.__defineGetter__(prop, function () {return target[tprop];});
    this.__defineSetter__(prop, function (x) {target[tprop] = x;return x;});
}


More information about the Es-discuss mailing list