Changed references to "desc" to "description".

This commit is contained in:
Michael Mathews 2010-12-17 15:28:18 +00:00
parent b136538f2c
commit 610c254aa5
9 changed files with 65 additions and 65 deletions

View File

@ -180,7 +180,7 @@
if (tag.type && tag.type.length && tag.type[0] !== '') {
tagValue.type = tag.type;
}
if (tag.pdesc) { tagValue.desc = tag.pdesc; }
if (tag.pdesc) { tagValue.description = tag.pdesc; }
if (typeof tag.poptional === 'boolean') { tagValue.optional = tag.poptional; }
if (typeof tag.pnullable === 'boolean') { tagValue.nullable = tag.pnullable; }
if (typeof tag.pdefault !== 'undefined') { tagValue.defaultvalue = tag.pdefault; }
@ -241,15 +241,15 @@
}
/**
Add a @desc tag if none exists on untagged text at start of comment.
Add a @description tag if none exists on untagged text at start of comment.
@private
@function fixDesc
@param {string} commentSrc
@return {string} With needed @desc tag added.
@return {string} With needed @description tag added.
*/
function fixDesc(commentSrc) {
if (!/^\s*@/.test(commentSrc)) {
commentSrc = '@desc ' + commentSrc;
commentSrc = '@description ' + commentSrc;
}
return commentSrc;
}
@ -291,7 +291,7 @@
}
if (tagAbout.setsDocletDesc) {
tags.addTag('desc', tags[i].value);
tags.addTag('description', tags[i].value);
}
if (tags[i].name === 'name') {
@ -330,7 +330,7 @@
}
if (tags[i].pdesc) {
tags.addTag('desc', tags[i].pdesc);
tags.addTag('description', tags[i].pdesc);
}
if (kind && kind !== tags[i].name) {

View File

@ -24,7 +24,7 @@
exports.synonyms = {
/*synonym => canonical*/
'description': 'desc',
'desc': 'description',
'function': 'method',
'var': 'property',
'field': 'property',
@ -106,11 +106,11 @@
isScalar: true
});
/** Syntax: @desc <text>
/** Syntax: @description <text>
@property {module:jsdoc/tagdictionary~TagDefinition} desc
@memberOf module:jsdoc/tagdictionary~tagDefinitions
*/
new TagDefinition('desc', { // t
new TagDefinition('description', { // t
isExported: true,
isScalar: true
});

View File

@ -61,14 +61,14 @@
describe('The tag#raw property', function() {
it('should be set to all the characters after the leading @', function() {
var tag = tags[0];
expect(tag.raw).to(include, 'desc Hello world');
expect(tag.raw).to(include, 'description Hello world');
});
});
describe('The tag#name property', function() {
it('should be set to the text after the leading @', function() {
var tag = tags[0];
expect(tag.name).to(eql, 'desc');
expect(tag.name).to(eql, 'description');
});
});
@ -85,7 +85,7 @@
(function testarea() {
/**
@desc Hello world
@description Hello world
@name Foo
@constructor
*/

View File

@ -2,7 +2,7 @@
var jsdoc,
doclets;
JSpec.describe('@desc', function() {
JSpec.describe('@description', function() {
before(function() {
// docsets can only be created by parsers
@ -15,26 +15,26 @@
});
describe('A doclet that starts with untagged text', function() {
it('should have an `desc` property set to the text', function() {
it('should have an `description` property set to the text', function() {
var doclet = doclets[0].toObject();
expect(doclet).to(have_property, 'desc');
expect(doclet.desc).to(eql, 'Here is Edward Bear, coming downstairs now,\nbump,\n bump,\n bump');
});
});
describe('A doclet that has a @desc tag', function() {
it('should have an `desc` property set to the text of that tag', function() {
var doclet = doclets[1].toObject();
expect(doclet).to(have_property, 'desc');
expect(doclet.desc).to(eql, 'Here is Edward Bear, coming downstairs now, bump, bump, bump');
expect(doclet).to(have_property, 'description');
expect(doclet.description).to(eql, 'Here is Edward Bear, coming downstairs now,\nbump,\n bump,\n bump');
});
});
describe('A doclet that has a @description tag', function() {
it('should have an `desc` property set to the text of that tag', function() {
it('should have an `description` property set to the text of that tag', function() {
var doclet = doclets[1].toObject();
expect(doclet).to(have_property, 'description');
expect(doclet.description).to(eql, 'Here is Edward Bear, coming downstairs now, bump, bump, bump');
});
});
describe('A doclet that has a @description tag', function() {
it('should have an `description` property set to the text of that tag', function() {
var doclet = doclets[2].toObject();
expect(doclet).to(have_property, 'desc');
expect(doclet.desc).to(eql, 'Here is Edward Bear, coming downstairs now, bump, bump, bump');
expect(doclet).to(have_property, 'description');
expect(doclet.description).to(eql, 'Here is Edward Bear, coming downstairs now, bump, bump, bump');
});
});
});
@ -52,7 +52,7 @@
/**
@namespace Bear
@desc Here is Edward Bear, coming downstairs now, bump, bump, bump
@description Here is Edward Bear, coming downstairs now, bump, bump, bump
*/
/**

View File

@ -53,10 +53,10 @@
expect(doclet.type).to(eql, ['string', 'number']);
});
it('should have a `desc` property set to the given description', function() {
it('should have a `description` property set to the given description', function() {
var doclet = doclets[3].toObject();
expect(doclet).to(have_property, 'desc');
expect(doclet.desc).to(eql, 'Here is a description.');
expect(doclet).to(have_property, 'description');
expect(doclet.description).to(eql, 'Here is a description.');
});
});
@ -82,10 +82,10 @@
expect(doclet.name).to(eql, 'zub');
});
it('should have a `desc` property set to the given description', function() {
it('should have a `description` property set to the given description', function() {
var doclet = doclets[5].toObject();
expect(doclet).to(have_property, 'desc');
expect(doclet.desc).to(eql, 'The description here.');
expect(doclet).to(have_property, 'description');
expect(doclet.description).to(eql, 'The description here.');
});
});

View File

@ -15,7 +15,7 @@
doclets = jsdoc.parser.result.map(function($){ return $.toObject(); });
});
describe('A doclet with a returns tag whose value has a type and desc', function() {
describe('A doclet with a returns tag whose value has a type and description', function() {
it('should have an `returns` property', function() {
var doclet = doclets[0];
expect(doclet).to(have_property, 'returns');
@ -29,14 +29,14 @@
expect(returns.type).to(eql, ['number']);
});
it('should have an `desc` property set to the given desc', function() {
it('should have an `description` property set to the given description', function() {
var returns = doclets[0].returns;
expect(returns).to(have_property, 'desc');
expect(returns.desc).to(eql, 'The size of the foo.');
expect(returns).to(have_property, 'description');
expect(returns.description).to(eql, 'The size of the foo.');
});
});
describe('A doclet with a (synonym) return tag whose value has a desc', function() {
describe('A doclet with a (synonym) return tag whose value has a description', function() {
it('should have an `returns` property', function() {
var doclet = doclets[1];
expect(doclet).to(have_property, 'returns');
@ -44,10 +44,10 @@
});
describe('The returns value of that doclet', function() {
it('should have an `desc` property set to the given desc', function() {
it('should have an `description` property set to the given description', function() {
var returns = doclets[1].returns;
expect(returns).to(have_property, 'desc');
expect(returns.desc).to(eql, 'So a horse walks into a....');
expect(returns).to(have_property, 'description');
expect(returns.description).to(eql, 'So a horse walks into a....');
});
});

View File

@ -33,12 +33,12 @@
expect(doclet.param[1].name).to(eql, 'message');
});
it('should not have a `type` or `desc` property ', function() {
it('should not have a `type` or `description` property ', function() {
var doclet = doclets[0];
expect(doclet.param[0].type).to(be_undefined);
expect(doclet.param[0].desc).to(be_undefined);
expect(doclet.param[0].description).to(be_undefined);
expect(doclet.param[1].type).to(be_undefined);
expect(doclet.param[1].desc).to(be_undefined);
expect(doclet.param[1].description).to(be_undefined);
});
});
@ -74,54 +74,54 @@
expect(doclet.param[0].name).to(eql, 'str');
});
it('should not have a `desc`', function() {
it('should not have a `description`', function() {
var doclet = doclets[2];
expect(doclet.param.desc).to(be_undefined);
expect(doclet.param.description).to(be_undefined);
});
});
describe('A doclet with one param tag having a type, name and a desc', function() {
it('should have a `param` array with a single member with a `type`, `name` and `desc`', function() {
describe('A doclet with one param tag having a type, name and a description', function() {
it('should have a `param` array with a single member with a `type`, `name` and `description`', function() {
var doclet = doclets[3];
expect(doclet).to(have_property, 'param');
expect(doclet.param[0].type).to(be_an, Array); // types are always arrays
expect(doclet.param[0].type).to(eql, ['string']);
expect(doclet.param[0].name).to(be_an, String);
expect(doclet.param[0].name).to(eql, 'message');
expect(doclet.param[0].desc).to(be_an, String);
expect(doclet.param[0].desc).to(eql, 'the message to encrypt.');
expect(doclet.param[0].description).to(be_an, String);
expect(doclet.param[0].description).to(eql, 'the message to encrypt.');
});
});
describe('A param tag using the dash syntax with a `type`, `name` and `desc`', function() {
it('should have a `type`, `name` and `desc`', function() {
describe('A param tag using the dash syntax with a `type`, `name` and `description`', function() {
it('should have a `type`, `name` and `description`', function() {
var param = doclets[4].param[0];
expect(param.type).to(be_an, Array); // types are always arrays
expect(param.type).to(eql, ['Panel']);
expect(param.name).to(be_an, String);
expect(param.name).to(eql, 'p');
expect(param.desc).to(be_an, String);
expect(param.desc).to(eql, 'The panel to update.');
expect(param.description).to(be_an, String);
expect(param.description).to(eql, 'The panel to update.');
});
});
describe('A param tag using the dash syntax with just a `desc`', function() {
it('should have a `desc` but no `type` or `name`', function() {
describe('A param tag using the dash syntax with just a `description`', function() {
it('should have a `description` but no `type` or `name`', function() {
var param = doclets[4].param[1];
expect(param.desc).to(be_an, String);
expect(param.desc).to(eql, 'The new content.');
expect(param.description).to(be_an, String);
expect(param.description).to(eql, 'The new content.');
expect(param.name).to(be_undefined);
expect(param.type).to(be_undefined);
});
});
describe('A param tag using the dash syntax with a `type` and a `desc`', function() {
it('should have a `desc` and `type` but no `name`', function() {
describe('A param tag using the dash syntax with a `type` and a `description`', function() {
it('should have a `description` and `type` but no `name`', function() {
var param = doclets[4].param[2];
expect(param.type).to(be_an, Array); // types are always arrays
expect(param.type).to(eql, ['boolean']);
expect(param.desc).to(be_an, String);
expect(param.desc).to(eql, 'Don\'t replace existing content.');
expect(param.description).to(be_an, String);
expect(param.description).to(eql, 'Don\'t replace existing content.');
expect(param.name).to(be_undefined);
});
});

View File

@ -32,7 +32,7 @@
describe('The value of the `exception` property', function() {
it('should be equal to the description of the given tag value', function() {
var doclet = doclets[0];
expect(doclet.exception.desc).to(eql, 'Denominator param cannot be zero.');
expect(doclet.exception.description).to(eql, 'Denominator param cannot be zero.');
});
});

View File

@ -31,7 +31,7 @@
});
describe('A doclet with two @tag <name>', function() {
it('should have a tag with a name property set to <name>, and description set to <desc>', function() {
it('should have a tag with a name property set to <name>, and description set to <description>', function() {
var doclet = doclets[1];
expect(doclet.tags[0]).to(be_an, String);
expect(doclet.tags[0]).to(be, 'experimental');