mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Ensure properties is only called once
This commit is contained in:
@@ -44,6 +44,8 @@ class Blar {}
|
||||
class MyElement extends PropertiesMixin(HTMLElement) {
|
||||
|
||||
static get properties() {
|
||||
this._calledProperties++;
|
||||
|
||||
return {
|
||||
prop: String,
|
||||
noStomp: String,
|
||||
@@ -111,6 +113,8 @@ MyElement.prototype._calledConnectedCallback = 0;
|
||||
MyElement.prototype._calledReady = 0;
|
||||
MyElement.prototype._callAttributeChangedCallback = 0;
|
||||
|
||||
MyElement.constructor.prototype._calledProperties = 0;
|
||||
|
||||
customElements.define('my-element', MyElement);
|
||||
|
||||
window.MyElement = MyElement;
|
||||
@@ -236,6 +240,7 @@ suite('class extends Polymer.PropertiesMixin', function() {
|
||||
assert.equal(el._calledConnectedCallback, 1);
|
||||
assert.equal(el._calledReady, 1);
|
||||
assert.equal(el._callAttributeChangedCallback, 0);
|
||||
assert.equal(el.constructor._calledProperties, 1);
|
||||
});
|
||||
|
||||
test('listeners', function() {
|
||||
|
||||
Reference in New Issue
Block a user