swc/ecmascript/jsdoc/tests/fixtures/virtual2.js
2020-08-14 18:20:25 +09:00

29 lines
629 B
JavaScript

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);
}
});