swc/ecmascript/jsdoc/tests/fixtures/virtual2.js

29 lines
629 B
JavaScript
Raw Normal View History

2020-08-14 12:20:25 +03:00
var Person = Klass.extend(
/** @lends Person.prototype */
{
/** @constructs Person */
initialize: function(name) {
this.name = name;
},
/**
* Callback for `say`.
*
* @callback Person~sayCallback
* @param {?string} err - Information about the error, if any.
* @param {?string} message - The message.
*/
/**
* Speak a message asynchronously.
*
* @param {Person~sayCallback} cb
*/
say: function(message, cb) {
if (!message) {
cb('You forgot the message!');
}
cb(null, this.name + ' says: ' + message);
}
});