+ },
+
+ /**
+ * Updates this instance with the properties of the given objects.
+ * Like the update function, but with special semantics for
+ * localized properties.
+ */
+ update: function update() {
+ let self = this;
+ // XXX: Duplication.
+
+ for (let i = 0; i < arguments.length; i++) {
+ let src = arguments[i];
+ Object.getOwnPropertyNames(src || {}).forEach(function (k) {
+ let desc = Object.getOwnPropertyDescriptor(src, k);
+ if (desc.value instanceof Class.Property)
+ desc = desc.value.init(k, this) || desc.value;
+
+ if (typeof desc.value === "function") {
+ let func = desc.value.wrapped || desc.value;
+ if (!func.superapply) {
+ func.__defineGetter__("super", function () Object.getPrototypeOf(self)[k]);
+ func.superapply = function superapply(self, args)
+ let (meth = Object.getPrototypeOf(self)[k])
+ meth && meth.apply(self, args);
+ func.supercall = function supercall(self)
+ func.superapply(self, Array.slice(arguments, 1));
+ }
+ }
+
+ try {
+ if ("value" in desc && (k in this.localizedProperties || k in this.magicalProperties))
+ this[k] = desc.value;
+ else
+ Object.defineProperty(this, k, desc);
+ }
+ catch (e) {}
+ }, this);
+ }
+ },
+
+ magicalProperties: {}