Avoid duplicates in Observables list

This commit is contained in:
Andreas Hocevar
2017-06-12 08:24:44 +02:00
parent 107792635d
commit b3ddcd4ed9
2 changed files with 4 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ exports.handlers = {
cls.observables = []; cls.observables = [];
} }
observable = observables[doclet.observable]; observable = observables[doclet.observable];
if (cls.observables.indexOf(observable) == -1) { if (observable.type && cls.observables.indexOf(observable) == -1) {
cls.observables.push(observable); cls.observables.push(observable);
} }
if (!cls.fires) { if (!cls.fires) {

View File

@@ -16,8 +16,10 @@
<tbody> <tbody>
<?js <?js
var self = this; var self = this;
var propsByName = {};
props.forEach(function(prop) { props.forEach(function(prop) {
if (!prop) { return; } if (!prop || propsByName[prop.name]) { return; }
propsByName[prop.name] = prop;
var setter = prop.readonly ? 'no' : 'yes'; var setter = prop.readonly ? 'no' : 'yes';
?> ?>