diff --git a/src/declaration/prototype.js b/src/declaration/prototype.js index 47591388f5..6a14732999 100644 --- a/src/declaration/prototype.js +++ b/src/declaration/prototype.js @@ -63,14 +63,20 @@ // get basal prototype var base = this.generateBasePrototype(extendee); // chain observe object - if (prototype.hasOwnProperty('observe') && base.hasOwnProperty('observe')) { - chainObject(prototype.observe, base.observe); - //console.log('observed:', prototype.observe); + if (prototype.hasOwnProperty('observe')) { + if (base.hasOwnProperty('observe')) { + chainObject(prototype.observe, base.observe); + } + // combine name list + prototype._observeNames = Object.keys(prototype.observe).concat(base._observeNames || []); } // chain publish object - if (prototype.hasOwnProperty('publish') && base.hasOwnProperty('publish')) { - chainObject(prototype.publish, base.publish); - //console.log('published:', prototype.publish); + if (prototype.hasOwnProperty('publish')) { + if (base.hasOwnProperty('publish')) { + chainObject(prototype.publish, base.publish); + } + // combine name list + prototype._publishNames = Object.keys(prototype.publish).concat(base._publishNames || []); } // chain custom api chainObject(prototype, base); diff --git a/src/instance/properties.js b/src/instance/properties.js index c1b105da35..c4267c8bfc 100644 --- a/src/instance/properties.js +++ b/src/instance/properties.js @@ -21,29 +21,32 @@ var properties = { // set up property observers observeProperties: function() { - // TODO(sjmiles): + // TODO(sjmiles): // we observe published properties so we can reflect them to attributes // ~100% of our team's applications would work without this: // perhaps we can make it optional somehow - //console.group('[%s]:observeProperties', this.localName); - // add observers as explicitly requested - for (var n in this.observe) { - //console.log('observable:', n); - var m = this.observe[n]; - //if (this.publish && this.publish[n]) { - //this.observeBoth(n, m); - //} else { - this.observeProperty(n, m); - //} + // + // add user's observers + var n$ = this._observeNames; + if (n$) { + for (var i=0, l=n$.length, n; (i