Specs: custom element constructor argument shouldn't clash with the module-global 'module' identifier

Review URL: https://codereview.chromium.org/829133003
This commit is contained in:
Hixie 2015-01-07 14:39:58 -08:00
parent f8cce94873
commit 79a529c6d9
3 changed files with 15 additions and 15 deletions

View File

@ -3,8 +3,8 @@ SKY MODULE - button widgets for calculator
<script>
class AbstractButton extends Element {
constructor (module) {
super(module);
constructor (hostModule) {
super(hostModule);
let selector = new SelectorQuery('.dynamic');
this.addEventListener('pointer-down', (event) => {
selector.findAll(this.shadowRoot).every((element) => element.setAttribute('clicked'));
@ -59,8 +59,8 @@ SKY MODULE - button widgets for calculator
class extends AbstractButton {
static get tagName() { return 'graybutton'; }
static get shadow() { return true; }
constructor (module) {
super(module);
constructor (hostModule) {
super(hostModule);
this.shadowRoot.append(module.document.findId('threed-button-shadow-tree').cloneNode(true));
}
}
@ -69,8 +69,8 @@ SKY MODULE - button widgets for calculator
class extends AbstractButton {
static get tagName() { return 'flatbutton'; }
static get shadow() { return true; }
constructor (module) {
super(module);
constructor (hostModule) {
super(hostModule);
this.shadowRoot.append(module.document.findId('flat-shadow-tree').cloneNode(true));
}
}

View File

@ -22,10 +22,10 @@ SKY MODULE - defines an <element> element
module.exports.Element = sky.registerElement(
class extends Element {
static get tagName() { return 'element'; }
constructor (module) {
super();
constructor (hostModule) {
super(hostModule);
this.state = 'loading';
this.module = module;
this.module = hostModule;
this.definedPrototype = sky.Element;
}
setPrototype(prototype) {
@ -44,8 +44,8 @@ SKY MODULE - defines an <element> element
}
let tagName = this.getAttribute('name');
let constructorName = tagName.charAt(0).toUpperCase() + tagName.slice(1) + 'Element';
let constructor = function (module) {
super(module);
let constructor = function (hostModule) {
super(hostModule);
if (this.init)
this.init();
if (style)

View File

@ -13,8 +13,8 @@ SKY MODULE - radio button and radio button group
class extends Element {
static get tagName() { return 'radio'; }
static get shadow() { return true; }
constructor (module) {
super(module);
constructor (hostModule) {
super(hostModule);
this.addEventListener('click', (event) => this.checked = true);
this.shadowRoot.append(module.document.findId('radio-shadow').content.cloneNode(true));
}
@ -53,8 +53,8 @@ SKY MODULE - radio button and radio button group
class extends Element {
static get tagName() { return 'radiogroup'; }
static get shadow() { return true; }
constructor (module) {
super(module);
constructor (hostModule) {
super(hostModule);
this.shadowRoot.append(module.document.findId('radiogroup-shadow').content.cloneNode(true));
}
get value () {