-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support @throws tag #305
Support @throws tag #305
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,6 +182,7 @@ YUI.add('docparser', function (Y) { | |
'augments': 'uses', // YUI convention for prototype mixins | ||
'depreciated': 'deprecated', // subtle difference | ||
'desciption': 'description', // shouldn't need the @description tag at all | ||
'exception': 'throws', // need to standardize on one or the other | ||
'extend': 'extends', // typo | ||
'function': 'method', // we may want standalone inner functions at some point | ||
'member': 'method', // probably meant method | ||
|
@@ -191,7 +192,8 @@ YUI.add('docparser', function (Y) { | |
'parma': 'param', // typo | ||
'propery': 'property', // typo | ||
'prop': 'property', // probably meant property | ||
'returns': 'return' // need to standardize on one or the other | ||
'returns': 'return', // need to standardize on one or the other | ||
'throw': 'throws' // need to standardize on one or the other | ||
}, | ||
|
||
/** | ||
|
@@ -376,7 +378,6 @@ YUI.add('docparser', function (Y) { | |
|
||
// @return {type} description // methods | ||
// @returns {type} description // methods | ||
// @throws {type} an error #2173342 | ||
// @injects {HTML|CSS|script} description | ||
// can be used by anthing that has an optional {type} and a description | ||
'return': function (tagname, value, target, block) { | ||
|
@@ -401,7 +402,30 @@ YUI.add('docparser', function (Y) { | |
target[tagname] = result; | ||
|
||
}, | ||
'throws': 'return', | ||
|
||
// @throws {type} description | ||
'throws': function (tagname, value, target) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. It was deliberate because I have the potential of change |
||
var desc = implodeString(trim(value)), | ||
type, | ||
match = REGEX_TYPE.exec(desc), | ||
result; | ||
|
||
if (match) { | ||
type = fixType(trim(match[2])); | ||
desc = trim(match[1] + match[3]); | ||
} | ||
|
||
result = { | ||
description: Y.unindent(explodeString(desc)) | ||
}; | ||
|
||
if (type) { | ||
result.type = type; | ||
} | ||
|
||
target[tagname] = result; | ||
}, | ||
|
||
'injects': 'return', | ||
|
||
// trying to overwrite the constructor value is a bad idea | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need
throw
orexception
unless users tell us it's a common mistake.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, OK! Moved out.