Skip to content

Commit

Permalink
Pass through fourth namespace param on attributeChangedCallback.
Browse files Browse the repository at this point in the history
  • Loading branch information
rictic committed Mar 30, 2018
1 parent 92d282a commit 91d4aeb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion lib/elements/dom-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@
* @param {string} name Name of attribute.
* @param {?string} old Old value of attribute.
* @param {?string} value Current value of attribute.
* @param {?string} namespace Attribute namespace.
* @return {void}
*/
attributeChangedCallback(name, old, value) {
attributeChangedCallback(name, old, value, namespace) {
if (old !== value) {
this.register();
}
Expand Down
5 changes: 3 additions & 2 deletions lib/legacy/legacy-element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,13 @@
* @param {string} name Name of attribute.
* @param {?string} old Old value of attribute.
* @param {?string} value Current value of attribute.
* @param {?string} namespace Attribute namespace.
* @return {void}
* @override
*/
attributeChangedCallback(name, old, value) {
attributeChangedCallback(name, old, value, namespace) {
if (old !== value) {
super.attributeChangedCallback(name, old, value);
super.attributeChangedCallback(name, old, value, namespace);
this.attributeChanged(name, old, value);
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/mixins/disable-upgrade-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
}

/** @override */
attributeChangedCallback(name, old, value) {
attributeChangedCallback(name, old, value, namespace) {
if (name == DISABLED_ATTR) {
if (!this.__dataEnabled && value == null && this.isConnected) {
super.connectedCallback();
}
} else {
super.attributeChangedCallback(name, old, value);
super.attributeChangedCallback(name, old, value, namespace);
}
}

Expand Down Expand Up @@ -113,4 +113,4 @@

})();

</script>
</script>
5 changes: 3 additions & 2 deletions lib/mixins/properties-changed.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,16 @@
* @param {string} name Name of attribute that changed
* @param {?string} old Old attribute value
* @param {?string} value New attribute value
* @param {?string} namespace Attribute namespace.
* @return {void}
* @suppress {missingProperties} Super may or may not implement the callback
*/
attributeChangedCallback(name, old, value) {
attributeChangedCallback(name, old, value, namespace) {
if (old !== value) {
this._attributeToProperty(name, value);
}
if (super.attributeChangedCallback) {
super.attributeChangedCallback(name, old, value);
super.attributeChangedCallback(name, old, value, namespace);
}
}

Expand Down
2 changes: 2 additions & 0 deletions test/smoke/behavior-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</template>
</dom-module>
<script>
/** @polymerBehavior */
var MyBehavior = {
properties: {
behaviorProp: {
Expand All @@ -37,6 +38,7 @@
}
}

/** @polymerBehavior */
var MyBehavior2 = {
ready: function() {
console.log(this.localName, 'MyBehavior2.ready');
Expand Down

0 comments on commit 91d4aeb

Please sign in to comment.