/tags/jsdoc_toolkit-1.4.0/test/data/test.js

http://jsdoc-toolkit.googlecode.com/ · JavaScript · 103 lines · 47 code · 9 blank · 47 comment · 0 complexity · 2ba52a94edf6ce1049677d2bea1105cc MD5 · raw file

  1. /**
  2. * @overview This library contains a lot of classes and functions.
  3. * @name Test Library
  4. * @author <a href="mailto:jsmith@company.com">Joe Smith</a>
  5. * @version 0.1
  6. */
  7. /**
  8. * Gets the current foo
  9. * @param {String} fooId The unique identifier for the foo.
  10. * @param [r] Recursion level.
  11. * @return {Object} Returns the current foo.
  12. * @throws {MalformedFoo} In the case of a fooId not being positve and evenly divisable by 9.
  13. */
  14. function getFoo(fooID, r){
  15. }
  16. /**@constructor*/ function Shape3D(){}
  17. Shape3D.prototype.shrink = function(ratio) {}
  18. /**
  19. * @desc This is a library of geometry-related functions.
  20. *
  21. */
  22. Shape2D /*a two-dimensional shape*/
  23. = {
  24. // Shape.Circle()
  25. /** @ignore */
  26. Circle: function(r, x, y){
  27. },
  28. Rect: "r"+makerect({
  29. callback: function(){
  30. flarp: function(){}
  31. }
  32. }),
  33. Triangle: { /* this is wicked };-) */
  34. /** A triangle with a 90 degree angle.
  35. @constructor
  36. @property {number} angles The angles.
  37. @rating {stars} 3
  38. @deprecated
  39. */
  40. Right: function(a, b, c) {
  41. /** The ratio. */
  42. this.ratio = a+b/c;
  43. }
  44. },
  45. /** The constant PI*/
  46. PI: 3.14,
  47. /** @constructor
  48. * @example
  49. * var myPent = new Polygon(5);
  50. * myPent.addSide(s1);
  51. * @example
  52. * var myHex = new Polygon(5).addSide(s2);
  53. */
  54. Polygon: function(sides) //how many sides
  55. {
  56. this.addSide = function(newSide) {
  57. }
  58. }
  59. };
  60. /**
  61. * A Geo.
  62. *
  63. */
  64. Geo = <!-- ignore me
  65. {
  66. /* flat surface */ Plane:
  67. function
  68. (
  69. w, // the width of the plane
  70. d // the depth of the plane
  71. ) {
  72. }
  73. }
  74. /**The e constant.
  75. @type number*/
  76. var E = 12345;
  77. /** meaning of life?
  78. @type integer*/
  79. var life = function(n) {return n}(42);
  80. // nested constructors
  81. /** @constructor */
  82. function ShapeFactory() {
  83. /** @constructor */
  84. this.SquareMaker = function(size) {
  85. /** @constructor */
  86. this.Square = function(s) {
  87. /** The size. */
  88. this.size = s;
  89. this.display = function() {
  90. alert("square: "+s);
  91. }
  92. }
  93. }
  94. }