/branches/version1.x/test/data/scope.js

http://jsdoc-toolkit.googlecode.com/ · JavaScript · 77 lines · 52 code · 14 blank · 11 comment · 0 complexity · 2057747e63f5460a64bc63ce00ac22eb MD5 · raw file

  1. var Record = new function() {
  2. var secretRecord = 1;
  3. function getSecretRecord() {
  4. alert("I am private.");
  5. }
  6. return /**@scope Record*/ {
  7. public_variable: 2,
  8. getRecord: function() {
  9. this.Reader = function() {
  10. }
  11. alert("I am public: "+this.public_variable+", "+secretRecord);
  12. }
  13. };
  14. }
  15. var File = function() {
  16. return /** @scope File */ {
  17. id: 255,
  18. getId: function() {
  19. alert(this.id);
  20. }
  21. };
  22. }()
  23. var Entry = function(subject) {
  24. this.subject = subject;
  25. this.getSubject = function(subjId) {
  26. alert(this.subject);
  27. };
  28. return this;
  29. }("abc00");
  30. dojo.declare(
  31. "dojo.widget.Widget",
  32. null,
  33. /**
  34. * @scope dojo.widget.Widget
  35. */
  36. {
  37. initializer: function(container, args) {
  38. this.children = [];
  39. this.extraArgs = {};
  40. this.log = function(){
  41. };
  42. }
  43. }
  44. );
  45. /** extra widgets */
  46. extra.widget = {
  47. }
  48. dojo.extend("dojo.widget.Widget",
  49. /**
  50. @scope dojo.widget.Widget.prototype
  51. @scope extra.widget
  52. */
  53. {
  54. /**
  55. * Does something.
  56. */
  57. doIt : function (one, two) {
  58. }
  59. }
  60. );
  61. Record.getRecord();
  62. File.getId();
  63. Entry.getSubject();