mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Allow the presence of inline tags for a @returns tag that does not have a type spec.
This commit is contained in:
parent
a507eced37
commit
39bf9adb2b
@ -35,7 +35,7 @@ function unescapeBraces(text) {
|
||||
var count = 0;
|
||||
var position = 0;
|
||||
var expression = '';
|
||||
var startIndex = string.indexOf('{');
|
||||
var startIndex = string.search(/\{[^@]/);
|
||||
var textStartIndex;
|
||||
|
||||
if (startIndex !== -1) {
|
||||
|
||||
8
test/fixtures/returnstag.js
vendored
8
test/fixtures/returnstag.js
vendored
@ -9,3 +9,11 @@ function find(targetName) {
|
||||
*/
|
||||
function bind(callback) {
|
||||
}
|
||||
|
||||
// This test exists because there used to be a bug in jsdoc which
|
||||
// would cause it to fail parsing.
|
||||
/**
|
||||
* @return An object to be passed to {@link find}.
|
||||
*/
|
||||
function convert(name) {
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
describe("@returns tag", function() {
|
||||
var docSet = jasmine.getDocSetFromFile('test/fixtures/returnstag.js'),
|
||||
find = docSet.getByLongname('find')[0],
|
||||
bind = docSet.getByLongname('bind')[0];
|
||||
bind = docSet.getByLongname('bind')[0],
|
||||
convert = docSet.getByLongname('convert')[0];
|
||||
|
||||
it('When a symbol has an @returns tag with a type and description, the doclet has a returns array that includes that return.', function() {
|
||||
expect(typeof find.returns).toBe('object');
|
||||
@ -15,4 +16,10 @@ describe("@returns tag", function() {
|
||||
expect(bind.returns.length).toBe(1);
|
||||
expect(bind.returns[0].description).toBe('The binding id.');
|
||||
});
|
||||
|
||||
it('When a symbol has an @returns tag wihtout a type but with an inline tag, the doclet does not confuse the inline tag for a type.', function() {
|
||||
expect(typeof convert.returns).toBe('object');
|
||||
expect(convert.returns.length).toBe(1);
|
||||
expect(convert.returns[0].description).toBe('An object to be passed to {@link find}.');
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user