lends6.js 730 B

123456789101112131415161718192021222324252627282930
  1. define([], function() {
  2. var Person = makeClass(
  3. /** @lends Person.prototype */
  4. {
  5. /** @constructs */
  6. initialize: function(name) {
  7. this.name = name;
  8. },
  9. /** Speak a message. */
  10. say: function(message) {
  11. return this.name + " says: " + message;
  12. }
  13. }
  14. );
  15. var Robot = makeClass(
  16. /** @lends Robot.prototype */
  17. {
  18. /** @constructs */
  19. initialize: function(name) {
  20. this.name = name;
  21. },
  22. /** Feign emotion. */
  23. emote: function() {
  24. return this.name + " loves you!";
  25. }
  26. }
  27. );
  28. });