Skip to content
This repository has been archived by the owner on Dec 31, 2017. It is now read-only.

prevent properties on functions showing up in annotations #81

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions lib/processor/dojodoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,29 @@ define([
'An object with the following properties:\n';

(function readProperties(object) {
var propertyMetadata;
for (var k in object.properties) {
if (_hasOwnProperty.call(object.properties, k)) {
var propertyMetadata,
properties = object.properties,
k;

// if the annotationObject is a function, we don't want to pick up any properties apart
// from what's on the prototype.
if (object.type === 'function') {
if (_hasOwnProperty.call(properties, 'prototype')) {
readProperties(properties.prototype);
}
return;
}

for (k in properties) {
if (_hasOwnProperty.call(properties, k)) {
// Type descriptor could be a plain JS object, or could be a constructor. It is often the
// latter.
if (k === 'prototype') {
readProperties(object.properties[k]);
readProperties(properties[k]);
}
// Filter out built-ins and constructor properties which come from dojo/_base/declare
else if (k !== 'constructor' && object.properties[k].file) {
propertyMetadata = object.properties[k].metadata;
else if (k !== 'constructor' && properties[k].file) {
propertyMetadata = properties[k].metadata;
additionalDescription += stringUtil.substitute(propertyTemplate, {
key: k,
type: propertyMetadata.type ? ' (' + propertyMetadata.type + (propertyMetadata.isOptional ? ', optional' : '') + ')' : '',
Expand Down