diff options
Diffstat (limited to 'tools/jsdoc-toolkit-2.4.0/app/test')
47 files changed, 1459 insertions, 0 deletions
diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/addon.js b/tools/jsdoc-toolkit-2.4.0/app/test/addon.js new file mode 100644 index 0000000..8886205 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/addon.js @@ -0,0 +1,24 @@ +String.prototype.reverse = function() { +} + +String.prototype.reverse.utf8 = function() { +} + +Function.count = function() { +} + +/** @memberOf Function */ +Function.count.reset = function() { +} + +/** @memberOf Function */ +count.getValue = function() { +} + +/** @memberOf Function.prototype */ +getSig = function() { +} + +/** @memberOf Function.prototype */ +Function.prototype.getProps = function() { +} diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/anon_inner.js b/tools/jsdoc-toolkit-2.4.0/app/test/anon_inner.js new file mode 100644 index 0000000..227eeee --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/anon_inner.js @@ -0,0 +1,14 @@ +/** + * @name bar + * @namespace + */ + +new function() { + /** + * @name bar-foo + * @function + * @param {number} x + */ + function foo(x) { + } +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/augments.js b/tools/jsdoc-toolkit-2.4.0/app/test/augments.js new file mode 100644 index 0000000..12e706e --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/augments.js @@ -0,0 +1,31 @@ +/** +@constructor +*/ +function Layout(p) { + this.init = function(p) { + } + + this.getId = function() { + } + + /** @type Page */ + this.orientation = "landscape"; +} + +/** +@constructor +@augments Layout +*/ +function Page() { + this.reset = function(b) { + } +} + +/** +@extends Page +@constructor +*/ +function ThreeColumnPage() { + this.init = function(resetCode) { + } +} diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/augments2.js b/tools/jsdoc-toolkit-2.4.0/app/test/augments2.js new file mode 100644 index 0000000..e8388f0 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/augments2.js @@ -0,0 +1,26 @@ +/** +@constructor +*/ +function LibraryItem() { + this.reserve = function() { + } +} + +/** +@constructor +*/ +function Junkmail() { + this.annoy = function() { + } +} + +/** +@inherits Junkmail.prototype.annoy as pester +@augments ThreeColumnPage +@augments LibraryItem +@constructor +*/ +function NewsletterPage() { + this.getHeadline = function() { + } +} diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/borrows.js b/tools/jsdoc-toolkit-2.4.0/app/test/borrows.js new file mode 100644 index 0000000..a5d8ea4 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/borrows.js @@ -0,0 +1,46 @@ +/** +@constructor +*/ +function Layout(p) { + /** initilize 1 */ + this.init = function(p) { + } + + /** get the id */ + this.getId = function() { + } + + /** @type string */ + this.orientation = "landscape"; + + function getInnerElements(elementSecretId){ + } +} + +/** A static method. */ +Layout.units = function() { +} + +/** +@constructor +@borrows Layout#orientation +@borrows Layout-getInnerElements +@borrows Layout.units +*/ +function Page() { + /** reset the page */ + this.reset = function(b) { + } +} + +/** +@constructor +@borrows Layout.prototype.orientation as this.orientation +@borrows Layout.prototype.init as #init +@inherits Page.prototype.reset as #reset +*/ +function ThreeColumnPage() { + /** initilize 2 */ + this.init = function(p) { + } +} diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/borrows2.js b/tools/jsdoc-toolkit-2.4.0/app/test/borrows2.js new file mode 100644 index 0000000..c0d5ea2 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/borrows2.js @@ -0,0 +1,23 @@ +// testing circular borrows + +/** + @class + @borrows Bar#zop as this.my_zop +*/ +function Foo() { + /** this is a zip. */ + this.zip = function() {} + + this.my_zop = new Bar().zop; +} + +/** + @class + @borrows Foo#zip as this.my_zip +*/ +function Bar() { + /** this is a zop. */ + this.zop = function() {} + + this.my_zip = new Foo().zip; +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/config.js b/tools/jsdoc-toolkit-2.4.0/app/test/config.js new file mode 100644 index 0000000..0748a21 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/config.js @@ -0,0 +1,22 @@ +/** + * @constructor + * @param person The person. + * @param {string} person.name The person's name. + * @config {integer} age The person's age. + * @config [id=1] Optional id number to use. + * @param connection + */ +function Contact(person, connection) { + +} + +/** + * @constructor + * @param persons + * @config {string} Father The paternal person. + * @config {string} Mother The maternal person. + * @config {string[]} Children And the rest. + */ +function Family(/**Object*/persons) { + +} diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/constructs.js b/tools/jsdoc-toolkit-2.4.0/app/test/constructs.js new file mode 100644 index 0000000..cca5dbd --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/constructs.js @@ -0,0 +1,18 @@ +var Person = makeClass( + /** + @scope Person + */ + { + /** + This is just another way to define a constructor. + @constructs + @param {string} name The name of the person. + */ + initialize: function(name) { + this.name = name; + }, + say: function(message) { + return this.name + " says: " + message; + } + } +);
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/encoding.js b/tools/jsdoc-toolkit-2.4.0/app/test/encoding.js new file mode 100644 index 0000000..ba64219 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/encoding.js @@ -0,0 +1,10 @@ + +/** + * @Constructor + * @desc 配置文件 + * @class 什么也不返回 + */ +function Test(conf) { + // do something; +} + diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/encoding_other.js b/tools/jsdoc-toolkit-2.4.0/app/test/encoding_other.js new file mode 100644 index 0000000..b144da4 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/encoding_other.js @@ -0,0 +1,12 @@ + +/** + * @Constructor + * @desc + * @class + */ +function Test(conf) { + // do something; +} + +// run with commanline option -e=iso-8859-5 + diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/event.js b/tools/jsdoc-toolkit-2.4.0/app/test/event.js new file mode 100644 index 0000000..7e41d6f --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/event.js @@ -0,0 +1,54 @@ +/** + * @name Kitchen + * @constructor + * @fires Bakery#event:donutOrdered + */ + +/** + * Fired when some cake is eaten. + * @name Kitchen#event:cakeEaten + * @function + * @param {Number} pieces The number of pieces eaten. + */ + +/** + * Find out if cake was eaten. + * @name Kitchen#cakeEaten + * @function + * @param {Boolean} wasEaten + */ + +/** + * @name getDesert + * @function + * @fires Kitchen#event:cakeEaten + */ + +/** + * @name Bakery + * @constructor + * @extends Kitchen + */ + +/** + * Fired when a donut order is made. + * @name Bakery#event:donutOrdered + * @event + * @param {Event} e The event object. + * @param {String} [e.topping] Optional sprinkles. + */ + +/** + * @constructor + * @borrows Bakery#event:donutOrdered as this.event:cakeOrdered + */ +function CakeShop() { +} + +/** @event */ +CakeShop.prototype.icingReady = function(isPink) { +} + +/** @event */ +function amHungry(/**Boolean*/enoughToEatAHorse) { +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/exports.js b/tools/jsdoc-toolkit-2.4.0/app/test/exports.js new file mode 100644 index 0000000..63a87cb --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/exports.js @@ -0,0 +1,14 @@ +/** @namespace */ +var mxn = {}; + +(function(){ + /** @exports Map as mxn.Map */ + var Map = + /** @constructor */ + mxn.Map = function() { + }; + + /** A method. */ + Map.prototype.doThings = function() { + }; +})();
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/functions_anon.js b/tools/jsdoc-toolkit-2.4.0/app/test/functions_anon.js new file mode 100644 index 0000000..e9dd6c1 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/functions_anon.js @@ -0,0 +1,39 @@ +/** an anonymous constructor executed inline */ +a = new function() { + /** a.b*/ + this.b = 1; + /** a.f */ + this.f = function() { + /** a.c */ + this.c = 2; + } +} + + +/** + named function executed inline +*/ +bar1 = function Zoola1() { + /** property of global */ + this.g = 1; +}(); + +/** + named constructor executed inline +*/ +bar2 = new function Zoola2() { + /** property of bar */ + this.p = 1; +}; + +/** module pattern */ +module = (function () { + /** won't appear in documentation */ + var priv = 1; + + /** @scope module */ + return { + /** will appear as a property of module */ + pub: 1 + } +})(); diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/functions_nested.js b/tools/jsdoc-toolkit-2.4.0/app/test/functions_nested.js new file mode 100644 index 0000000..f044faf --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/functions_nested.js @@ -0,0 +1,33 @@ +/** @constructor */ +function Zop() { +} + +/** + @class +*/ +Foo = function(id) { + // this is a bit twisted, but if you call Foo() you will then + // modify Foo(). This is kinda, sorta non-insane, because you + // would have to call Foo() 100% of the time to use Foo's methods + Foo.prototype.methodOne = function(bar) { + alert(bar); + }; + + // same again + Foo.prototype.methodTwo = function(bar2) { + alert(bar2); + }; + + // and these are only executed if the enclosing function is actually called + // and who knows if that will ever happen? + Bar = function(pez) { + alert(pez); + }; + Zop.prototype.zap = function(p){ + alert(p); + }; + + // but this is only visible inside Foo + function inner() { + } +}; diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/global.js b/tools/jsdoc-toolkit-2.4.0/app/test/global.js new file mode 100644 index 0000000..5ea4894 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/global.js @@ -0,0 +1,13 @@ +/** ecks */ +var x = [1, 2, 4]; + +var y = { + foo: function(){ + } +} + +bar = function() { +} + +function zop() { +} diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/globals.js b/tools/jsdoc-toolkit-2.4.0/app/test/globals.js new file mode 100644 index 0000000..3f83fb1 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/globals.js @@ -0,0 +1,25 @@ +function example(/**Circle*/a, b) { + /** a global defined in function */ + var number = a; + + var hideNumber = function(){ + } + + setNumber = function(){ + } + alert('You have chosen: ' + b); +} + +function initPage() { + var supported = document.createElement && document.getElementsByTagName; + if (!supported) return; + // start of DOM script + var x = document.getElementById('writeroot'); + // etc. +} + +/** an example var */ +var document = new Document(x, y); + +var getNumber = function(){ +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/ignore.js b/tools/jsdoc-toolkit-2.4.0/app/test/ignore.js new file mode 100644 index 0000000..d3fac9e --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/ignore.js @@ -0,0 +1,10 @@ +/** + * A test constructor. + * @constructor + * @ignore + */ +function Ignored() { + /** a method */ + this.bar = function() { + } +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/inner.js b/tools/jsdoc-toolkit-2.4.0/app/test/inner.js new file mode 100644 index 0000000..37cfa9d --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/inner.js @@ -0,0 +1,16 @@ +/** + * @constructor + */ +function Outer() { + /** + * @constructor + */ + function Inner(name) { + /** The name of this. */ + this.name = name; + } + + this.open = function(name) { + return (new Inner(name)); + } +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/jsdoc_test.js b/tools/jsdoc-toolkit-2.4.0/app/test/jsdoc_test.js new file mode 100644 index 0000000..0817712 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/jsdoc_test.js @@ -0,0 +1,477 @@ +/** + * @fileoverview This file is to be used for testing the JSDoc parser + * It is not intended to be an example of good JavaScript OO-programming, + * nor is it intended to fulfill any specific purpose apart from + * demonstrating the functionality of the + * <a href='http://sourceforge.net/projects/jsdoc'>JSDoc</a> parser + * + * @author Gabriel Reid gab_reid@users.sourceforge.net + * @version 0.1 + */ + + +/** + * Construct a new Shape object. + * @class This is the basic Shape class. + * It can be considered an abstract class, even though no such thing + * really existing in JavaScript + * @constructor + * @throws MemoryException if there is no more memory + * @throws GeneralShapeException rarely (if ever) + * @return {Shape|Coordinate} A new shape. + */ +function Shape(){ + + /** + * This is an example of a function that is not given as a property + * of a prototype, but instead it is assigned within a constructor. + * For inner functions like this to be picked up by the parser, the + * function that acts as a constructor <b>must</b> be denoted with + * the <b>@constructor</b> tag in its comment. + * @type String + */ + this.getClassName = function(){ + return "Shape"; + } + + /** + * This is an inner method, just used here as an example + * @since version 0.5 + * @author Sue Smart + */ + function addReference(){ + // Do nothing... + } + +} + +/** + * Create a new Hexagon instance. + * @extends Shape + * @class Hexagon is a class that is a <i>logical</i> sublcass of + * {@link Shape} (thanks to the <code>@extends</code> tag), but in + * reality it is completely unrelated to Shape. + * @param {int} sideLength The length of one side for the new Hexagon + * @example + * var h = new Hexagon(2); + * @example + * if (hasHex) { + * hex = new Hexagon(5); + * color = hex.getColor(); + * } + */ +function Hexagon(sideLength) { +} + + +/** + * This is an unattached (static) function that adds two integers together. + * @param {int} One The first number to add + * @param {int} Two The second number to add + * @author Gabriel Reid + * @deprecated So you shouldn't use it anymore! Use {@link Shape#getClassName} instead. + */ +function Add(One, Two){ + return One + Two; +} + + +/** + * The color of this shape + * @type Color + */ +Shape.prototype.color = null; + +/** + * The border of this shape. + * @field + * @type int + */ +Shape.prototype.border = function(){return border;}; + +/* + * These are all the instance method implementations for Shape + */ + +/** + * Get the coordinates of this shape. It is assumed that we're always talking + * about shapes in a 2D location here. + * @requires The {@link Shape} class + * @returns A Coordinate object representing the location of this Shape + * @type Coordinate[] + */ +Shape.prototype.getCoords = function(){ + return this.coords; +} + +/** + * Get the color of this shape. + * @see #setColor + * @see The <a href="http://example.com">Color</a> library. + * @link Shape + * @type Color + */ +Shape.prototype.getColor = function(){ + return this.color; +} + +/** + * Set the coordinates for this Shape + * @param {Coordinate} coordinates The coordinates to set for this Shape + */ +Shape.prototype.setCoords = function(coordinates){ + this.coords = coordinates; +} + +/** + * Set the color for this Shape + * @param {Color} color The color to set for this Shape + * @param other There is no other param, but it can still be documented if + * optional parameters are used + * @throws NonExistantColorException (no, not really!) + * @see #getColor + */ +Shape.prototype.setColor = function(color){ + this.color = color; +} + +/** + * Clone this shape + * @returns A copy of this shape + * @type Shape + * @author Gabriel Reid + */ +Shape.prototype.clone = function(){ + return new Shape(); +} + +/** + * Create a new Rectangle instance. + * @class A basic rectangle class, inherits from Shape. + * This class could be considered a concrete implementation class + * @constructor + * @param {int} width The optional width for this Rectangle + * @param {int} height Thie optional height for this Rectangle + * @author Gabriel Reid + * @see Shape is the base class for this + * @augments Shape + * @hilited + */ +function Rectangle(width, // This is the width + height // This is the height + ){ + if (width){ + this.width = width; + if (height){ + this.height = height; + } + } +} + + +/* Inherit from Shape */ +Rectangle.prototype = new Shape(); + +/** + * Value to represent the width of the Rectangle. + * <br>Text in <b>bold</b> and <i>italic</i> and a + * link to <a href="http://sf.net">SourceForge</a> + * @private + * @type int + */ +Rectangle.prototype.width = 0; + +/** + * Value to represent the height of the Rectangle + * @private + * @type int + */ +Rectangle.prototype.height = 0; + +/** + * Get the type of this object. + * @type String + */ +Rectangle.prototype.getClassName= function(){ + return "Rectangle"; +} + +/** + * Get the value of the width for the Rectangle + * @type int + * @see Rectangle#setWidth + */ +Rectangle.prototype.getWidth = function(){ + return this.width; +} + +/** + * Get the value of the height for the Rectangle. + * Another getter is the {@link Shape#getColor} method in the + * {@link Shape} base class. + * @return The height of this Rectangle + * @type int + * @see Rectangle#setHeight + */ +Rectangle.prototype.getHeight = function(){ + return this.height; +} + +/** + * Set the width value for this Rectangle. + * @param {int} width The width value to be set + * @see #setWidth + */ +Rectangle.prototype.setWidth = function(width){ + this.width = width; +} + +/** + * Set the height value for this Rectangle. + * @param {int} height The height value to be set + * @see #getHeight + */ +Rectangle.prototype.setHeight = function(height){ + this.height = height; +} + +/** + * Get the value for the total area of this Rectangle + * @return total area of this Rectangle + * @type int + */ +Rectangle.prototype.getArea = function(){ + return width * height; +} + + +/** + * Create a new Square instance. + * @class A Square is a subclass of {@link Rectangle} + * @param {int} width The optional width for this Rectangle + * @param {int} height The optional height for this Rectangle + * @augments Rectangle + */ +function Square(width, height){ + if (width){ + this.width = width; + if (height){ + this.height = height; + } + } + +} + +/* Square is a subclass of Rectangle */ +Square.prototype = new Rectangle(); + +/** + * Set the width value for this Shape. + * @param {int} width The width value to be set + * @see #getWidth + */ +Square.prototype.setWidth = function(width){ + this.width = this.height = width; +} + +/** + * Set the height value for this Shape + * Sets the {@link Rectangle#height} attribute in the Rectangle. + * @param {int} height The height value to be set + */ +Square.prototype.setHeight = function(height){ + this.height = this.width = height; +} + + +/** + * Create a new Circle instance based on a radius. + * @class Circle class is another subclass of Shape + * @extends Shape + * @param {int} radius The optional radius of this {@link Circle } + * @mixin Square.prototype.setWidth as this.setDiameter + */ +function Circle(radius){ + if (radius) { + /** The radius of the this Circle. */ + this.radius = radius; + } +} + +/* Circle inherits from {@link Shape} */ +Circle.prototype = new Shape(); + +/** + * The radius value for this Circle + * @private + * @type int + */ +Circle.prototype.radius = 0; + +/** + * A very simple class (static) field that is also a constant + * @final + * @type float + */ +Circle.PI = 3.14; + +/** + * Get the radius value for this Circle + * @type int + * @see #setRadius + */ +Circle.prototype.getRadius = function(){ + return this.radius; +} + +/** + * Set the radius value for this Circle + * @param {int} radius The {@link Circle#radius} value to set + * @see #getRadius + */ +Circle.prototype.setRadius = function(radius){ + this.radius = radius; +} + +/** + * An example of a class (static) method that acts as a factory for Circle + * objects. Given a radius value, this method creates a new Circle. + * @param {int} radius The radius value to use for the new Circle. + * @type Circle + */ +Circle.createCircle = function(radius){ + return new Circle(radius); +} + + +/** + * Create a new Coordinate instance based on x and y grid data. + * @class Coordinate is a class that can encapsulate location information. + * @param {int} [x=0] The optional x portion of the Coordinate + * @param {int} [y=0] The optinal y portion of the Coordinate + */ +function Coordinate(x, y){ + if (x){ + this.x = x; + if (y){ + this.y = y; + } + } +} + +/** + * The x portion of the Coordinate + * @type int + * @see #getX + * @see #setX + */ +Coordinate.prototype.x = 0; + +/** + * The y portion of the Coordinate + * @type int + * @see #getY + * @see #setY + */ +Coordinate.prototype.y = 0; + +/** + * Gets the x portion of the Coordinate. + * @type int + * @see #setX + */ +Coordinate.prototype.getX = function(){ + return this.x; +} + +/** + * Get the y portion of the Coordinate. + * @type int + * @see #setY + */ +Coordinate.prototype.getY = function(){ + return this.y; +} + +/** + * Sets the x portion of the Coordinate. + * @param {int} x The x value to set + * @see #getX + */ +Coordinate.prototype.setX = function(x){ + this.x = x; +} + +/** + * Sets the y portion of the Coordinate. + * @param {int} y The y value to set + * @see #getY + */ +Coordinate.prototype.setY = function(y){ + this.y = y; +} + +/** + * @class This class exists to demonstrate the assignment of a class prototype + * as an anonymous block. + */ +function ShapeFactory(){ +} + +ShapeFactory.prototype = { + /** + * Creates a new {@link Shape} instance. + * @return A new {@link Shape} + * @type Shape + */ + createShape: function(){ + return new Shape(); + } +} + +/** + * An example of a singleton class + * @param ... Arguments represent {@link coordinate}s in the shape. + * @constructor + */ +MySingletonShapeFactory = function(){ + + /** + * Get the next {@link Shape} + * @type Shape + * @return A new {@link Shape} + */ + this.getShape = function(){ + return null; + } + +} + + +/** + * Create a new Foo instance. + * @class This is the Foo class. It exists to demonstrate 'nested' classes. + * @constructor + * @see Foo.Bar + */ +function Foo(){} + +/** + * Creates a new instance of Bar. + * @class This class exists to demonstrate 'nested' classes. + * @constructor + * @see Foo.Bar + */ +function Bar(){} + +/** + * Nested class + * @constructor + */ +Foo.Bar = function(){ + /** The x. */ this.x = 2; +} + +Foo.Bar.prototype = new Bar(); +/** The y. */ +Foo.Bar.prototype.y = '3'; diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/lend.js b/tools/jsdoc-toolkit-2.4.0/app/test/lend.js new file mode 100644 index 0000000..92b15d5 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/lend.js @@ -0,0 +1,33 @@ + /** @class */ +var Person = Class.create( + /** + @lends Person.prototype + */ + { + initialize: function(name) { + this.name = name; + }, + say: function(message) { + return this.name + ': ' + message; + } + } + ); + +/** @lends Person.prototype */ +{ + /** like say but more musical */ + sing: function(song) { + } +} + +/** @lends Person */ +{ + getCount: function() { + } +} + +/** @lends Unknown.prototype */ +{ + notok: function() { + } +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/memberof.js b/tools/jsdoc-toolkit-2.4.0/app/test/memberof.js new file mode 100644 index 0000000..883bbde --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/memberof.js @@ -0,0 +1,19 @@ +/** @constructor */ +pack = function() { + this.init = function(){} + function config(){} +} + + pack.build = function(task) {}; + +/** @memberOf pack */ +pack.install = function() {} + +/** @memberOf pack */ +pack.install.overwrite = function() {} + +/** @memberOf pack */ +clean = function() {} + +/** @memberOf pack-config */ +install = function() {}; diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/memberof2.js b/tools/jsdoc-toolkit-2.4.0/app/test/memberof2.js new file mode 100644 index 0000000..bc3d9d8 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/memberof2.js @@ -0,0 +1,38 @@ +/** + * @constructor + */ +function Foo() { + /** + @memberOf Foo.prototype + */ + function bar(a, b) { + } + + /** + @memberOf Foo + */ + var zip = function(p, q) { + } + + /** + @memberOf Foo + */ + function zop( x,y ) { + } + + /** + @memberOf Foo + @constructor + */ + function Fiz() { + /** A method of Foo#Fiz. */ + this.fipple = function(fop){} + } +} + +/** + @memberOf Foo# + */ +var blat = function() { + +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/memberof3.js b/tools/jsdoc-toolkit-2.4.0/app/test/memberof3.js new file mode 100644 index 0000000..8c25942 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/memberof3.js @@ -0,0 +1,33 @@ +/** +* @name Foo +* @class +*/ + +/**#@+ +* @memberOf Foo# +* @field +*/ + +/** +* @name bar +* @type Object[] +*/ + +/**#@-*/ + +/** +* @name Foo2 +* @class +*/ + +/**#@+ +* @memberOf Foo2# +* @field +*/ + +/** +* @name bar +* @type Object[] +*/ + +/**#@-*/
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/memberof_constructor.js b/tools/jsdoc-toolkit-2.4.0/app/test/memberof_constructor.js new file mode 100644 index 0000000..80fde73 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/memberof_constructor.js @@ -0,0 +1,17 @@ +/** @constructor */ +function Circle(){} + +/** + @constructor + @memberOf Circle# + */ +Circle.prototype.Tangent = function(){}; + +// renaming Circle#Tangent to Circle#Circle#Tangent + +/** + @memberOf Circle#Tangent# + */ +Circle.prototype.Tangent.prototype.getDiameter = function(){}; + + diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/module.js b/tools/jsdoc-toolkit-2.4.0/app/test/module.js new file mode 100644 index 0000000..5b3fe42 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/module.js @@ -0,0 +1,17 @@ +/** @namespace */ +myProject = myProject || {}; + +/** @namespace */ +myProject.myModule = (function () { + /** describe myPrivateVar here */ + var myPrivateVar = ""; + + var myPrivateMethod = function () { + } + + /** @scope myProject.myModule */ + return { + myPublicMethod: function () { + } + }; +})();
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/multi_methods.js b/tools/jsdoc-toolkit-2.4.0/app/test/multi_methods.js new file mode 100644 index 0000000..bab35c7 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/multi_methods.js @@ -0,0 +1,25 @@ + +/** + Get the entire flavor. + @name flavor^3 + @function + @returns {Object} The entire flavor hash. +*/ +/** + Get a named flavor. + @name flavor^2 + @function + @param {String} name The name of the flavor to get. + @returns {String} The value of that flavor. +*/ +/** + Set the flavor. + @param {String} name The name of the flavor to set. + @param {String} value The value of the flavor. + @returns {String} The value of that flavor. +*/ +function flavor(name, value) { + if (arguments.length > 1) flavor[name] = value; + else if (arguments.length == 1) return flavor[name]; + else return flavor; +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/name.js b/tools/jsdoc-toolkit-2.4.0/app/test/name.js new file mode 100644 index 0000000..e88a51a --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/name.js @@ -0,0 +1,19 @@ +/** + @name Response + @class +*/ + +Response.prototype = { + /** + @name Response#text + @function + @description + Gets the body of the response as plain text + @returns {String} + Response as text + */ + + text: function() { + return this.nativeResponse.responseText; + } +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/namespace_nested.js b/tools/jsdoc-toolkit-2.4.0/app/test/namespace_nested.js new file mode 100644 index 0000000..46cafa2 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/namespace_nested.js @@ -0,0 +1,23 @@ +/** + @namespace This is the first namespace. +*/ +ns1 = {}; + +/** + This is the second namespace. + @namespace +*/ +ns1.ns2 = {}; + +/** + This part of ns1.ns2 + @constructor +*/ +ns1.ns2.Function1 = function() { +}; + +ns1.staticFunction = function() { +}; + +/** A static field in a namespace. */ +ns1.ns2.staticField = 1; diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/nocode.js b/tools/jsdoc-toolkit-2.4.0/app/test/nocode.js new file mode 100644 index 0000000..1cf99bc --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/nocode.js @@ -0,0 +1,13 @@ +/**#nocode+*/ + /** + @name star + @function + */ + function blahblah() { + + } +/**#nocode-*/ + +function yaddayadda() { + +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/oblit_anon.js b/tools/jsdoc-toolkit-2.4.0/app/test/oblit_anon.js new file mode 100644 index 0000000..8d9e941 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/oblit_anon.js @@ -0,0 +1,20 @@ +/** the options */ +opt = Opt.get( + arguments, + { + d: "directory", + c: "conf", + "D[]": "define" + } +); + +/** configuration */ +opt.conf = { + /** keep */ + keep: true, + /** base */ + base: getBase(this, {p: properties}) +} + + + diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/overview.js b/tools/jsdoc-toolkit-2.4.0/app/test/overview.js new file mode 100644 index 0000000..1dfc09b --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/overview.js @@ -0,0 +1,20 @@ +/** + * @overview This "library" contains a + * lot of classes and functions. + * @example + <pre> + var x (x < 1); + alert("This 'is' \"code\""); + </pre> + * @name My Cool Library + * @author Joe Smith jsmith@company.com + * @version 0.1 + */ + +/** + * Gets the current foo + * @param {String} fooId The unique identifier for the foo. + * @return {Object} Returns the current foo. + */ +function getFoo(fooID){ +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/param_inline.js b/tools/jsdoc-toolkit-2.4.0/app/test/param_inline.js new file mode 100644 index 0000000..09845b2 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/param_inline.js @@ -0,0 +1,37 @@ +/** + @constructor + @param columns The number of columns. +*/ +function Layout(/**int*/columns){ + /** + @param [id] The id of the element. + @param elName The name of the element. + */ + this.getElement = function( + /** string */ elName, + /** number|string */ id + ) { + }; + + /** + @constructor + */ + this.Canvas = function(top, left, /**int*/width, height) { + /** Is it initiated yet? */ + this.initiated = true; + } + + this.rotate = function(/**nothing*/) { + } + + /** + @param x + @param y + @param {zoppler} z*/ + this.init = function(x, y, /**abbler*/z) { + /** The xyz. */ + this.xyz = x+y+z; + this.getXyz = function() { + } + } +} diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/params_optional.js b/tools/jsdoc-toolkit-2.4.0/app/test/params_optional.js new file mode 100644 index 0000000..18bf598 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/params_optional.js @@ -0,0 +1,8 @@ + +/** + * @param {Page[]} pages + * @param {number} [id] Specifies the id, if applicable. + * @param {String} [title = This is untitled.] Specifies the title. + */ +function Document(pages, id, title){ +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/prototype.js b/tools/jsdoc-toolkit-2.4.0/app/test/prototype.js new file mode 100644 index 0000000..1147008 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/prototype.js @@ -0,0 +1,17 @@ +/** @constructor */ +function Article() { +} + +Article.prototype.init = function(title) { + /** the instance title */ + this.title = title; + + /** the static counter */ + Article.counter = 1; +} + +a = new Article(); +a.Init("my title"); + +print(a.title); +print(Article.counter);
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/prototype_nested.js b/tools/jsdoc-toolkit-2.4.0/app/test/prototype_nested.js new file mode 100644 index 0000000..e8ca1ce --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/prototype_nested.js @@ -0,0 +1,9 @@ +/** @constructor */ +function Word() { +} + +Word.prototype.reverse = function() { +} + +Word.prototype.reverse.utf8 = function() { +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/prototype_oblit.js b/tools/jsdoc-toolkit-2.4.0/app/test/prototype_oblit.js new file mode 100644 index 0000000..6cfc39c --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/prototype_oblit.js @@ -0,0 +1,13 @@ +/** @constructor */ +function Article() { +} + +Article.prototype = { + /** instance get title */ + getTitle: function(){ + } +} + +/** static get title */ +Article.getTitle = function(){ +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/prototype_oblit_constructor.js b/tools/jsdoc-toolkit-2.4.0/app/test/prototype_oblit_constructor.js new file mode 100644 index 0000000..9248248 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/prototype_oblit_constructor.js @@ -0,0 +1,24 @@ +/** @constructor */ +function Article() { +} + +Article.prototype = { + /** @constructor */ + Title: function(title) { + /** the value of the Title instance */ + this.title = title; + }, + + init: function(pages) { + /** the value of the pages of the Article instance */ + this.pages = pages; + } +} + +f = new Article(); +f.init("one two three"); + +t = new f.Title("my title"); + +print(f.pages); +print(t.title);
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/public.js b/tools/jsdoc-toolkit-2.4.0/app/test/public.js new file mode 100644 index 0000000..35d34f6 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/public.js @@ -0,0 +1,10 @@ +/**@constructor*/ +function Foo() { + /** + @public + @static + @field + */ + var bar = function(x) { + } +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/scripts/code.js b/tools/jsdoc-toolkit-2.4.0/app/test/scripts/code.js new file mode 100644 index 0000000..e9d7ed2 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/scripts/code.js @@ -0,0 +1,5 @@ +/** + @class + */ +function thisiscode() { +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/scripts/notcode.txt b/tools/jsdoc-toolkit-2.4.0/app/test/scripts/notcode.txt new file mode 100644 index 0000000..fcd737e --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/scripts/notcode.txt @@ -0,0 +1,5 @@ +(This is not code) +function foo(){{{{ +( +! +@
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/shared.js b/tools/jsdoc-toolkit-2.4.0/app/test/shared.js new file mode 100644 index 0000000..e1c277a --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/shared.js @@ -0,0 +1,42 @@ + +/** + * Builtin object. + * @class + * @name Array + */ + +/**#@+ + * Extension to builtin array. + * @memberOf Array + * @method + */ + +/** + * @returns Boolen if some array members... + */ +Array.prototype.some = function(){}; + +/** + * Change every element of an array. + * @returns Filtered array copy. + */ +Array.prototype.filter = function(){}; + +/**#@-*/ + + +/** + * A first in, first out data structure. + * @constructor + */ +Queue = function(){}; + +/**#@+ + * Extension to Queue. + * @memberOf Queue + */ + +rewind = function(){ +} + +// should close automatically here.
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/shared2.js b/tools/jsdoc-toolkit-2.4.0/app/test/shared2.js new file mode 100644 index 0000000..3f7736a --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/shared2.js @@ -0,0 +1,2 @@ +startOver = function(){ +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/shortcuts.js b/tools/jsdoc-toolkit-2.4.0/app/test/shortcuts.js new file mode 100644 index 0000000..f738f1e --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/shortcuts.js @@ -0,0 +1,22 @@ +// /**#=+ +// * { +// * 'D': 'Date.prototype', +// * '$N': 'Number' +// * } +// */ +// var D = Date.prototype, +// $N = Number; +// +// D.locale = function(){ +// }; +// +// /** +// @return {string} The cardinal number string. +// */ +// $N.nth = function(n){ +// }; +// +// LOAD.file = function(){ +// } +// +// /**#=-*/
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/static_this.js b/tools/jsdoc-toolkit-2.4.0/app/test/static_this.js new file mode 100644 index 0000000..9407b20 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/static_this.js @@ -0,0 +1,13 @@ +/** the parent */ +var box = {}; + +/** @namespace */ +box.holder = {} + +box.holder.foo = function() { + /** the counter */ + this.counter = 1; +} + +box.holder.foo(); +print(box.holder.counter); diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/synonyms.js b/tools/jsdoc-toolkit-2.4.0/app/test/synonyms.js new file mode 100644 index 0000000..09066b9 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/synonyms.js @@ -0,0 +1,31 @@ +/** + @class + @inherits Bar#zop as #my_zop +*/ +function Foo() { + /** this is a zip. */ + this.zip = function() {} + + /** from Bar */ + this.my_zop = new Bar().zop; +} + +/** + @class + @borrows Foo#zip as this.my_zip +*/ +function Bar() { + /** this is a zop. */ + this.zop = function() {} + + /** from Foo */ + this.my_zip = new Foo().zip; +} + +/** @namespace */ +var myObject = { + /** + @type function + */ + myFunc: getFunction() +}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/tosource.js b/tools/jsdoc-toolkit-2.4.0/app/test/tosource.js new file mode 100644 index 0000000..706d476 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/tosource.js @@ -0,0 +1,23 @@ +/** + * @param {Object} object + * @return {string} + */ +function valueOf(object) {} + +/** + * @param {Object} object + * @return {string} + */ +function toString(object) {} + +/** + * @param {Object} object + * @return {string} + */ +function toSource(object) {} + +/** + * @param {Object} object + * @return {string} + */ +function constructor(object) {}
\ No newline at end of file diff --git a/tools/jsdoc-toolkit-2.4.0/app/test/variable_redefine.js b/tools/jsdoc-toolkit-2.4.0/app/test/variable_redefine.js new file mode 100644 index 0000000..2c07da0 --- /dev/null +++ b/tools/jsdoc-toolkit-2.4.0/app/test/variable_redefine.js @@ -0,0 +1,14 @@ +/** @constructor */ +function Foo() { + var bar = 1; + bar = 2; // redefining a private + + this.baz = 1; + baz = 2; // global + + /** a private */ + var blap = { + /** in here */ + tada: 1 + } +}
\ No newline at end of file |