Skip to content

Commit

Permalink
Remove PropertiesElement in favor of PropertiesMixin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Nov 30, 2017
1 parent 8af1480 commit 40f02ea
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 64 deletions.
42 changes: 0 additions & 42 deletions lib/elements/properties-element.html

This file was deleted.

16 changes: 8 additions & 8 deletions lib/mixins/properties-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@

/**
* Returns the super class constructor for the given class, if it is an
* instance of the PropertiesClass.
* instance of the PropertiesMixin.
*
* @param {PropertiesClassConstructor} constructor PropertiesClass constructor
* @return {PropertiesClassConstructor} Super class constructor
* @param {PropertiesMixinConstructor} constructor PropertiesMixin constructor
* @return {PropertiesMixinConstructor} Super class constructor
*/
function superForClass(constructor) {
const proto = /** @type {PropertiesClassConstructor} */ (constructor).prototype;
const proto = /** @type {PropertiesMixinConstructor} */ (constructor).prototype;
const superCtor = Object.getPrototypeOf(proto).constructor;
if (superCtor.prototype instanceof PropertiesClass) {
if (superCtor.prototype instanceof PropertiesMixin) {
return superCtor;
}
}
Expand All @@ -83,7 +83,7 @@
* given class. Properties not in object format are converted to at
* least {type}.
*
* @param {PropertiesClassConstructor} constructor PropertiesClass constructor
* @param {PropertiesMixinConstructor} constructor PropertiesMixin constructor
* @return {Object} Memoized properties object
*/
function ownProperties(constructor) {
Expand All @@ -102,7 +102,7 @@
* @implements {Polymer_PropertiesMixin}
* @unrestricted
*/
class PropertiesClass extends base {
class PropertiesMixin extends base {

/**
* Implements standard custom elements getter to observes the attributes
Expand Down Expand Up @@ -203,7 +203,7 @@

}

return PropertiesClass;
return PropertiesMixin;

});

Expand Down
4 changes: 2 additions & 2 deletions test/runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
'unit/async.html',
'unit/behaviors.html',
'unit/polymer.element.html',
'unit/polymer.properties-element.html',
'unit/polymer.properties-element-with-property-accessors.html',
'unit/polymer.properties-mixin.html',
'unit/polymer.properties-mixin-with-property-accessors.html',
'unit/polymer.legacyelement.html',
'unit/debounce.html',
'unit/inheritance.html',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
<meta charset="utf-8">
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../../web-component-tester/browser.js"></script>
<link rel="import" href="../../lib/elements/properties-element.html">
<link rel="import" href="../../lib/mixins/properties-mixin.html">
<link rel="import" href="../../lib/mixins/property-accessors.html">
<body>

<dom-module id="my-element">
<script>
HTMLImports.whenReady(function() {

class MyElement extends Polymer.PropertyAccessors(Polymer.PropertiesElement) {
class MyElement extends Polymer.PropertyAccessors(Polymer.PropertiesMixin(HTMLElement)) {

static get properties() {
return {
Expand Down Expand Up @@ -200,7 +200,7 @@
</test-fixture>

<script>
suite('class extends Polymer.PropertiesElement', function() {
suite('class extends Polymer.PropertiesMixin', function() {

var el;

Expand All @@ -215,7 +215,6 @@

test('instanceof', function() {
assert.instanceOf(el, HTMLElement);
assert.instanceOf(el, Polymer.PropertiesElement);
assert.instanceOf(el, window.MyElement);
});

Expand Down Expand Up @@ -261,7 +260,6 @@

test('instanceof', function() {
assert.instanceOf(el, HTMLElement);
assert.instanceOf(el, Polymer.PropertiesElement);
assert.instanceOf(el, window.MyElement);
assert.instanceOf(el, window.SubElement);
});
Expand Down Expand Up @@ -311,7 +309,6 @@

test('instanceof', function() {
assert.instanceOf(el, HTMLElement);
assert.instanceOf(el, Polymer.PropertiesElement);
assert.instanceOf(el, window.MyElement);
assert.instanceOf(el, window.SubElement);
assert.instanceOf(el, window.SubMixinElement);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
<meta charset="utf-8">
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../../web-component-tester/browser.js"></script>
<link rel="import" href="../../lib/elements/properties-element.html">
<link rel="import" href="../../lib/mixins/properties-mixin.html">
<body>

<dom-module id="my-element">
<script>
HTMLImports.whenReady(function() {

class MyElement extends Polymer.PropertiesElement {
class MyElement extends Polymer.PropertiesMixin(HTMLElement) {

static get properties() {
return {
Expand Down Expand Up @@ -220,7 +220,7 @@
</test-fixture>

<script>
suite('class extends Polymer.PropertiesElement', function() {
suite('class extends Polymer.PropertiesMixin', function() {

var el;

Expand All @@ -235,7 +235,6 @@

test('instanceof', function() {
assert.instanceOf(el, HTMLElement);
assert.instanceOf(el, Polymer.PropertiesElement);
assert.instanceOf(el, window.MyElement);
});

Expand Down Expand Up @@ -304,7 +303,6 @@

test('instanceof', function() {
assert.instanceOf(el, HTMLElement);
assert.instanceOf(el, Polymer.PropertiesElement);
assert.instanceOf(el, window.MyElement);
assert.instanceOf(el, window.SubElement);
});
Expand Down Expand Up @@ -354,7 +352,6 @@

test('instanceof', function() {
assert.instanceOf(el, HTMLElement);
assert.instanceOf(el, Polymer.PropertiesElement);
assert.instanceOf(el, window.MyElement);
assert.instanceOf(el, window.SubElement);
assert.instanceOf(el, window.SubMixinElement);
Expand Down

0 comments on commit 40f02ea

Please sign in to comment.