mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 03:01:48 +03:00
30 lines
730 B
JavaScript
30 lines
730 B
JavaScript
define([], function() {
|
|
var Person = makeClass(
|
|
/** @lends Person.prototype */
|
|
{
|
|
/** @constructs */
|
|
initialize: function(name) {
|
|
this.name = name;
|
|
},
|
|
/** Speak a message. */
|
|
say: function(message) {
|
|
return this.name + " says: " + message;
|
|
}
|
|
}
|
|
);
|
|
|
|
var Robot = makeClass(
|
|
/** @lends Robot.prototype */
|
|
{
|
|
/** @constructs */
|
|
initialize: function(name) {
|
|
this.name = name;
|
|
},
|
|
/** Feign emotion. */
|
|
emote: function() {
|
|
return this.name + " loves you!";
|
|
}
|
|
}
|
|
);
|
|
});
|