checking in jsdoc dir so people can generate docs themselves

This commit is contained in:
Eric Rowell
2014-01-12 00:39:08 -08:00
parent 98b282b819
commit 8dd503c7bd
376 changed files with 24397 additions and 2 deletions

View File

@@ -0,0 +1,45 @@
Testing JSDoc 3
===============
Running Tests
-------------
Running tests is easy. Just change your working directory to the jsdoc folder
and run the following command on Windows:
jsdoc -T
Or on OS X, Linux, and other POSIX-compliant platforms:
./jsdoc -T
If you can't get the short-form commands to work, try invoking Java directly:
java -cp lib/js.jar org.mozilla.javascript.tools.shell.Main \
-modules node_modules -modules rhino -modules lib -modules . \
jsdoc.js -T
Writing Tests
-------------
Adding tests is pretty easy, too. You can write tests for JSDoc itself (to
make sure tags and the parser, etc. are working properly), tests for plugins, and/or
tests for templates.
JSDoc 3 uses Jasmine (https://github.com/pivotal/jasmine) as its testing framework.
Take a look at that project's wiki for documentation on writing tests in general.
### Tests for JSDoc
Take a look at the files in the ```test``` directory for many examples of
writing tests for JSDoc itself. The ```test\fixtures``` directory hold fixtures
for use in the tests, and the ```test\specs``` directory holds the tests themselves.
### Tests for plugins
Tests for plugins are found in the ```plugins\test``` directory. Plugins containing
tests that were installed with the Jakefile install task will be run automatically.
### Tests for templates
TODO

View File

@@ -0,0 +1,57 @@
/*global jasmine: true */
(function() {
var withoutAsync = {};
["it", "beforeEach", "afterEach"].forEach(function(jasmineFunction) {
withoutAsync[jasmineFunction] = jasmine.Env.prototype[jasmineFunction];
return jasmine.Env.prototype[jasmineFunction] = function() {
var args = Array.prototype.slice.call(arguments, 0);
var timeout = null;
if (isLastArgumentATimeout(args)) {
timeout = args.pop();
}
if (isLastArgumentAnAsyncSpecFunction(args))
{
var specFunction = args.pop();
args.push(function() {
return asyncSpec(specFunction, this, timeout);
});
}
return withoutAsync[jasmineFunction].apply(this, args);
};
});
function isLastArgumentATimeout(args)
{
return args.length > 0 && (typeof args[args.length-1]) === "number";
}
function isLastArgumentAnAsyncSpecFunction(args)
{
return args.length > 0 && (typeof args[args.length-1]) === "function" && args[args.length-1].length > 0;
}
function asyncSpec(specFunction, spec, timeout) {
if (timeout == null){timeout = jasmine.DEFAULT_TIMEOUT_INTERVAL || 1000;}
var done = false;
spec.runs(function() {
try {
return specFunction(function(error) {
done = true;
if (error != null) {
return spec.fail(error);
}
});
} catch (e) {
done = true;
throw e;
}
});
return spec.waitsFor(function() {
if (done === true) {
return true;
}
}, "spec to complete", timeout);
}
}).call(this);

View File

@@ -0,0 +1,17 @@
/** @constructor */
function Thingy() {
/** @abstract */
this.pez = 2;
}
// same as...
/** @constructor */
function OtherThingy() {
/** @virtual */
this.pez = 2;
}

29
jsdoc-master/test/fixtures/accesstag.js vendored Normal file
View File

@@ -0,0 +1,29 @@
/** @constructor */
function Thingy() {
/** @access private */
var foo = 0;
/** @access protected */
this._bar = 1;
/** @access public */
this.pez = 2;
}
// same as...
/** @constructor */
function OtherThingy() {
/** @private */
var foo = 0;
/** @protected */
this._bar = 1;
/** @public */
this.pez = 2;
}

13
jsdoc-master/test/fixtures/alias.js vendored Normal file
View File

@@ -0,0 +1,13 @@
var myObject = (function() {
/** Give x another name.
@alias myObject
@namespace
*/
var x = {
/** document me */
myProperty: 'foo'
}
return x;
})();

10
jsdoc-master/test/fixtures/alias2.js vendored Normal file
View File

@@ -0,0 +1,10 @@
(function() {
/** @alias ns.Myclass# */
var x = {
/** document me */
myProperty: 'foo'
}
return x;
})();

12
jsdoc-master/test/fixtures/alias3.js vendored Normal file
View File

@@ -0,0 +1,12 @@
Klass('trackr.CookieManager',
/** @class
@alias trackr.CookieManager
@param {object} kv
*/
function(kv) {
/** document me */
this.value = kv;
}
);

View File

@@ -0,0 +1,7 @@
(function() {
/** @alias <global>.log */
var log = function() {
}
})();

View File

@@ -0,0 +1,18 @@
(function () {
/**
* Creates a new test object.
* @alias Test
* @constructor
*/
var Test = function(testName) {
/** Document me. */
this.name = testName;
}
/** Document me. */
Test.prototype.run = function(message) {
};
/** Document me. */
Test.counter = 1;
})();

View File

@@ -0,0 +1,19 @@
/**
* @namespace
*/
var A = {};
(function(ns) {
/**
* @namespace
* @alias A.F
*/
var f = {};
/**
* @return {String}
*/
f.method = function(){};
ns.F = f;
})(A);

View File

@@ -0,0 +1,19 @@
/**
* @namespace
*/
var A = {};
/**
* @namespace
* @alias A.F
*/
var f = {};
(function(ns) {
/**
* @return {String}
*/
f.method = function(){};
ns.F = f;
})(A);

46
jsdoc-master/test/fixtures/also.js vendored Normal file
View File

@@ -0,0 +1,46 @@
/** @class */
function Asset() {
this._name = '';
this._shape = '';
this._shhhhKeepThisSecret = '';
}
/**
*
* Set the value of the name property.
* @param {string} newName
*
*//**
*
* Get the value of the name property.
* @returns {string}
*
*/
Asset.prototype.name = function(newName) {
if (newName) { this._name = newName; }
else { return this._name; }
};
/**
* Set the value of the shape property.
* @param {string} newShape
*//**
* Set the value of the shape property, plus some other property.
* @param {string} newShape
* @param {string} mysteryProperty
*//**
* Get the value of the shape property.
* @returns {string}
*/
Asset.prototype.shape = function(newShape, mysteryProperty) {
if (newShape && mysteryProperty) {
this._shape = newShape;
this._shhhhKeepThisSecret = mysteryProperty;
}
else if (newShape) {
this._shape = newShape;
}
else {
return this._shape;
}
};

View File

@@ -0,0 +1,53 @@
/**
* @constructor
*/
function Foo() {
/** First property */
this.prop1 = true;
}
/**
* Second property
* @type {String}
*/
Foo.prototype.prop2 = "parent prop2";
/**
* First parent method.
*/
Foo.prototype.method1 = function() {};
/**
* Second parent method.
*/
Foo.prototype.method2 = function() {};
/**
* @constructor
* @extends Foo
*/
function Bar() {
/** Thrid prop **/
this.prop3 = true;
}
/**
* Second child method.
*/
Bar.prototype.method2 = function() {};
/**
* @constructor
* @extends {Bar}
*/
function Baz() {
/** Override prop1 */
this.prop1 = "new";
}
/**
* Third grandchild method.
*/
Baz.prototype.method3 = function() {};

View File

@@ -0,0 +1,6 @@
// Test for @augments/@extends tags that refer to undefined symbols
/**
* @constructor
* @extends UndocumentedThing
*/
function Qux() {}

View File

@@ -0,0 +1,18 @@
// test to see that we can @augment multiple things (code allows for it)
/** @class */
function Foo() {
}
/** A method. */
Foo.prototype.method1 = function () {};
/** @class */
function Bar() {
}
/** Another method. */
Bar.prototype.method2 = function () {}
/** @class
* @augments Foo
* @augments Bar */
function FooBar() {
}

10
jsdoc-master/test/fixtures/authortag.js vendored Normal file
View File

@@ -0,0 +1,10 @@
/** @constructor
@author Michael Mathews <micmath@gmail.com>
*/
function Thingy() {
}
/** @author John Doe <john.doe@gmail.com>
* @author Jane Doe <jane.doe@gmail.com> */
function Thingy2() {
}

View File

@@ -0,0 +1,14 @@
/** @namespace
@borrows trstr as trim
*/
var util = {
"trim": trstr
};
/**
Remove whitespace from around a string.
@param {string} str
*/
function trstr(str) {
}

View File

@@ -0,0 +1,21 @@
/** @namespace
@borrows rtrim
*/
var str = {
rtrim: util.rtrim
};
/** @namespace
@borrows rtrim
*/
var util = {
rtrim: rtrim
};
/**
Remove whitespace from the right side of a string.
@param {string} str
*/
function rtrim(str) {
}

View File

@@ -0,0 +1,21 @@
/**
* @param {requestResponseCallback} cb
*/
function makeSpecialRequest(cb) {
}
/**
* @param {wrongTypeCallback} cb
*/
function makeExtraSpecialRequest(cb) {
}
/**
* @callback requestResponseCallback
* @param {number} responseCode
* @param {string} responseText
*/
/**
* @callback {(object|string)} wrongTypeCallback
*/

View File

@@ -0,0 +1,7 @@
/**
* Asdf.
* @class
* @classdesc A description of the class.
*/
function Foo () {
}

12
jsdoc-master/test/fixtures/classtag.js vendored Normal file
View File

@@ -0,0 +1,12 @@
/**
Describe the Ticker class here.
@class
*/
var Ticker = function() {
};
/**
Describe the NewsSource class here.
@class NewsSource
*/

View File

@@ -0,0 +1,6 @@
/** @constant */
var FOO = 1;
/** @const BAR */
/** @const {string} BAZ */

View File

@@ -0,0 +1,15 @@
/**
Describe your constructor function here.
@class Describe your class here.
@constructor
@param {string} url
@throws MalformedURL
*/
function Feed(url) {
}
/**
Document your method here.
*/
Feed.prototype.refresh = function() {
}

View File

@@ -0,0 +1,19 @@
Classify('TextBlock', {
/**
Document your constructor function here.
@constructs TextBlock
@classdesc Describe your class here
@param {object} opts
@throws MissingNode
*/
construct: function(node, opts) {
},
/**
Document your method here.
@memberof TextBlock#
*/
align: function() {
}
});

View File

@@ -0,0 +1,16 @@
Classify('Menu',
/**
@constructs Menu
@param items
*/
function (items) {
},
{
/**
@memberof Menu#
*/
show: function(){
}
}
);

View File

@@ -0,0 +1,26 @@
/**
A class that represents a person.
@class
*/
var Person = Class.create({
/**
@constructs Person
@param {string} name
*/
initialize: function(name) {
/** The name of the person. */
this.name = name;
},
/**
@memberof Person#
@param {string} message
*/
say: function(message) {
/** The person's message. */
this.message = message;
}
});

View File

@@ -0,0 +1,24 @@
var Person = Class.create(/** @lends Person# */{
/**
Describe the constructor.
@classdesc A class that represents a person.
@constructs
@param {string} name
*/
initialize: function(name) {
/** The name of the person. */
this.name = name;
},
/**
@param {string} message
*/
say: function(message) {
/** The person's message. */
this.message = message;
}
});

View File

@@ -0,0 +1,14 @@
Duck = (function() {
return /** @lends Duck# */ {
/**
Constructs a duck.
@constructs
@param tog
*/
constructor: function(tog) {
},
/** Say hello. */
quack: function() {
}
}
})();

View File

@@ -0,0 +1,6 @@
/** @constructor
@copyright (c) 2011 Michael Mathews
*/
function Thingy() {
}

View File

@@ -0,0 +1,34 @@
/**
@default
*/
var request = null;
/**
@default
*/
var response = 'ok';
/**
@default
*/
var rcode = 200;
/**
@default
*/
var rvalid = true;
/**
@default
*/
var rerrored = false;
/**
@default the parent window
*/
var win = getParentWindow();
/**
@default
*/
var header = getHeaders(request);

View File

@@ -0,0 +1,11 @@
/** @deprecated
*/
function foo() {
}
/** @deprecated since version 2.0
*/
function bar() {
}

View File

@@ -0,0 +1,7 @@
/** Blah Blah Blah
* @desc halb halb halb
*/
var x;
/** @description lkjasdf */
var y;

View File

@@ -0,0 +1,5 @@
/**
A builder function for the Stick application;
@var {function} Application
*/
var {Application} = require("stick");

23
jsdoc-master/test/fixtures/doclet.js vendored Normal file
View File

@@ -0,0 +1,23 @@
/**
Markdown asterisks in a doclet that does not use leading asterisks.
**Strong** is strong.
* List item 1.
* List item 2.
@param {string} thingy - The thingy.
*/
function test1(thingy) {
}
/**
* Markdown asterisks in a doclet that uses leading asterisks.
* **Strong** is strong.
*
* * List item 1.
* * List item 2.
* @param {string} thingy - The thingy.
*/
function test2(thingy) {
}

11
jsdoc-master/test/fixtures/enumtag.js vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Enum for tri-state values.
* @enum {number}
*/
var TriState = {
/** true */
TRUE: 1,
FALSE: -1,
/** @type {boolean} */
MAYBE: true
};

View File

@@ -0,0 +1,30 @@
/**
* @class
*/
var Hurl = function () {
};
/**
* Throw a snowball.
*
* @fires Hurl#snowball
* @fires Hurl#event:brick
*/
Hurl.prototype.snowball = function () {
/**
* @event Hurl#snowball
*/
this.emit('snowball', {});
};
/**
* Throw a football match.
*
* @emits Hurl#footballMatch
*/
Hurl.prototype.footballMatch = function () {
/**
* @event Hurl#footballMatch
*/
this.emit('footballMatch', {});
};

View File

@@ -0,0 +1,14 @@
/** @example
* console.log("foo");
* console.log("bar");
*/
var x;
/** @example
* console.log("foo");
* console.log("bar");
* @example
* <caption>Example 2</caption>
* 1 + 2;
*/
var y;

View File

@@ -0,0 +1,20 @@
/**
@throws {InvalidArgumentException}
*/
function foo(x) {
}
/**
@exception Will throw an error if argument is null.
*/
function bar(x) {
}
/**
@exception {DivideByZero} Argument x must be non-zero.
*/
function pez(x) {
}

15
jsdoc-master/test/fixtures/exports.js vendored Normal file
View File

@@ -0,0 +1,15 @@
/**
* An example of a server-side JavaScript module.
* @module hello/world
* @example
* var g = require('hello/world').sayHello('Gracie');
*/
/**
* Generate a greeting.
* @param {string} [subject="world"] To whom we greet.
* @returns {string}
*/
exports.sayHello = function(subject) {
return 'Hello ' + (subject || 'World');
};

View File

@@ -0,0 +1,20 @@
define(function () {
/**
A module representing a shirt.
@exports my/shirt
@version 1.0
*/
var shirt = {
/** A property of the module. */
color: "black",
/** @constructor */
Turtleneck: function(size) {
/** A property of the class. */
this.size = size;
}
};
return shirt;
});

View File

@@ -0,0 +1,18 @@
define(
["my/buttons"],
function () {
/**
A module representing a coat.
@exports my/coat
@requires my/buttons
@version 1.0
*/
var myModule = function(wool) {
/** document me */
this.wool = wool;
}
return myModule;
}
);

View File

@@ -0,0 +1,22 @@
define(
/**
Utility functions to ease working with DOM elements.
@exports html/utils
*/
function () {
var exports = {
/** Get the value of a property on an element. */
getStyleProperty: function(element, propertyName) {
// ...
}
};
/** Determine if an element is in the document head. */
exports.isInHead = function(element) {
// ...
}
return exports;
}
);

View File

@@ -0,0 +1,12 @@
define(
/** @exports some/module */
function () {
/** @class */
function myClass() {}
/** Some method */
myClass.prototype.myMethod = function () {};
return new myClass();
}
);

24
jsdoc-master/test/fixtures/externals.js vendored Normal file
View File

@@ -0,0 +1,24 @@
/**
* The built in string object.
* @external String
* @see {@link https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String String}
*/
/**
* Adds a new method to the built-in string.
* @function external:String#rot13
* @example
* var greeting = new String('hello world');
* console.log( greeting.rot13() ); // uryyb jbeyq
*/
/**
* The jQuery plugin namespace.
* @external "jQuery.fn"
* @see {@link http://docs.jquery.com/Plugins/Authoring The jQuery Plugin Guide}
*/
/**
* A jQuery plugin to make stars fly around your home page.
* @function external:"jQuery.fn".starfairy
*/

View File

@@ -0,0 +1,11 @@
/**
Namespace provided by the browser.
@external XMLHttpRequest
@see https://developer.mozilla.org/en/xmlhttprequest
*/
/**
Extends the built in XMLHttpRequest to send data encoded with a secret key.
@class EncryptedRequest
@extends external:XMLHttpRequest
*/

7
jsdoc-master/test/fixtures/file.js vendored Normal file
View File

@@ -0,0 +1,7 @@
/**
* @overview This is a file doclet.
* @copyright Michael Mathews 2011
*/
function ignoreMe() {
}

View File

@@ -0,0 +1,7 @@
/** @func Foo */
function Foo() {
}
/** @method */
function Bar() {
}

37
jsdoc-master/test/fixtures/getset.js vendored Normal file
View File

@@ -0,0 +1,37 @@
/** @class */
var Person = makeClass(
/** @lends Person# */
{
/** Set up initial values. */
initialize: function(name) {
},
/** Speak a message. */
say: function(message) {
return this.name + " says: " + message;
},
/**
* The name of the person.
* @type {string}
*/
get name() {
return this._name;
},
/**
* @type {string}
* @param val
*/
set name(val) {
this._name = name;
},
/**
* @type {number}
*/
get age() {
return 25;
}
}
);

16
jsdoc-master/test/fixtures/globaltag.js vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
@global
@constructor
*/
window.Bar = new Function('', a, b, c);
(function() {
/** @global */
var foo;
foo = 'hello foo';
this.foo = foo;
}).apply(window);

View File

@@ -0,0 +1,6 @@
/**
@ignore
*/
function foo(x) {
}

View File

@@ -0,0 +1,6 @@
/**
@ignore value that shouldn't be here
*/
function foo(x) {
}

3
jsdoc-master/test/fixtures/include.js vendored Normal file
View File

@@ -0,0 +1,3 @@
// Used to test jsdoc/util/include
var myGlobal = require('jsdoc/util/global');
myGlobal.__globalForIncludeTest__++;

View File

@@ -0,0 +1,2 @@
/** Inline Comment 1 */ this.test = function(){}
/** Inline Comment 2 */ this.test2 = function(){};

7
jsdoc-master/test/fixtures/inner.js vendored Normal file
View File

@@ -0,0 +1,7 @@
function sendMessage(text) {
/** document me */
var encoding = 'utf8';
/** document me */
function encrypt(){}
}

View File

@@ -0,0 +1,18 @@
/** @constructor */
function Message(to) {
var headers = {},
response;
/** document me */
headers.to = to;
(function() {
/** document me */
response.code = '200';
/** document me */
headers.from = '';
})()
}

View File

@@ -0,0 +1,19 @@
/** @constructor */
function Message(to) {
var headers = {};
/** document me */
headers.to = to;
(function() {
var headers = {
/** document me */
cache: {}
};
/** document me */
headers.from = '';
})()
}

View File

@@ -0,0 +1,3 @@
foo();
function foo() {}

View File

@@ -0,0 +1 @@
var foo = 0;

View File

@@ -0,0 +1,24 @@
/** @namespace */
var constructor = {
/** document me */
toString: function(){}
};
/** @namespace */
var prototye = {
/** document me */
valueOf: function(){}
}
/**
This is Object
@namespace Object
*/
/**
This is Object.hasOwnProperty
@method Object.hasOwnProperty
*/
// NOTE: you can't document a prototype of an object in JSDoc -- seriously, you just can't

2
jsdoc-master/test/fixtures/kindtag.js vendored Normal file
View File

@@ -0,0 +1,2 @@
/** @kind function */
var x;

16
jsdoc-master/test/fixtures/lends.js vendored Normal file
View File

@@ -0,0 +1,16 @@
/** @class */
var Person = makeClass(
/** @lends Person# */
{
/** Set up initial values. */
initialize: function(name) {
/** The name of the person. */
this.name = name;
},
/** Speak a message. */
say: function(message) {
return this.name + " says: " + message;
}
}
);

18
jsdoc-master/test/fixtures/lends2.js vendored Normal file
View File

@@ -0,0 +1,18 @@
var Person = makeClass(
/** @lends Person# */
{
/** Construct a Person.
@constructs Person
*/
initialize: function(name) {
/** The name of the person. */
this.name = name;
},
/** Speak a message. */
say: function(message) {
return this.name + " says: " + message;
}
}
);

18
jsdoc-master/test/fixtures/lends3.js vendored Normal file
View File

@@ -0,0 +1,18 @@
/** @class */
var Person = makeClass(
/**
* @lends Person#
*/
{
/** Set up initial values. */
initialize: function(name) {
/** The name of the person. */
this.name = name;
},
/** Speak a message. */
say: function(message) {
return this.name + " says: " + message;
}
}
);

View File

@@ -0,0 +1,14 @@
declare({
globals: /** @lends */ {
/** document me */
'test': function() { },
/** @namespace */
'test1': {
/** document me */
'test2': function() { }
}
}
});

View File

@@ -0,0 +1,2 @@
/** @license GPL v2 */
var x;

15
jsdoc-master/test/fixtures/linktag.js vendored Normal file
View File

@@ -0,0 +1,15 @@
/** @namespace ns */
var ns = {};
/**
* Similar to [the bar function]{@link bar}.
* @see {@link bar}
*/
ns.foo = function () {
}
/**
* @see {@link ns.foo}
*/
function bar() {
}

View File

@@ -0,0 +1,34 @@
/** @module myModule */
/** An event (has listeners).
* @event MyEvent
* @memberof module:myModule
* @param {number} foo - asdf. */
/** A handler.
* @listens module:myModule.MyEvent
* @listens module:myModule~Events.event:Event2
* @listens fakeEvent
*/
function MyHandler() {
}
/** Another handler.
* @listens module:myModule.MyEvent
*/
function AnotherHandler() {
}
/** a namespace.
* @namespace */
var Events = {
};
/** Another event (has listeners).
* @event Event2
* @memberof module:myModule~Events
*/
/** An event with no listeners.
* @event module:myModule#Event3 */

View File

@@ -0,0 +1,10 @@
This is a header
----
This is some text.
this is some code
* this
* a
* list

View File

@@ -0,0 +1,11 @@
/** @constructor
@memberof mathlib
*/
function Data() {
/** @member */
this.point = {};
}
/** @namespace */
mathlib = {Data: Data};

View File

@@ -0,0 +1,10 @@
create(
'Observable',
{
/** @memberof Observable */
cache: [],
/** @memberof Observable.prototype */
publish: function(msg) {}
}
);

View File

@@ -0,0 +1,19 @@
/** @module terrain
@example
var terrain = require('terrain'),
forest = new terrain.Forest(),
tree = new forest.Tree();
*/
/** @class */
exports.Forest = function(){}
var Forest = exports.Forest;
/**
@class
@memberof module:terrain
*/
Forest.prototype.Tree = function() {
/** A leaf */
this.leaf = 1;
}

View File

@@ -0,0 +1,16 @@
/**
* Namespace doStuff.
* @namespace doStuff
*/
/**
* Function with the same name as its namespace.
* @memberof doStuff
*/
function doStuff() {}
/**
* Function with a different name than the namespace.
* @memberof doStuff
*/
function doOtherStuff() {}

View File

@@ -0,0 +1,44 @@
/** @constructor
*/
function Data() {
/**
The current position.
@type {object}
@property {boolean} needsRevalidate Does this point need to be revalidated?
*/
this.point = {
/**
The x coordinate of the point.
@type {number}
@name point.x
@memberof! Data#
*/
x: 0,
/**
The y coordinate of the point.
@type {number}
@name point.y
@memberof! Data#
@see {@link Data#point.x}
*/
y: 0,
needsRevalidate: false
};
}
var map = {
/**
@type {Array}
@name map.routes
@memberof! <global>
@property {Data#point} point
*/
routes: []
}
/** The current cursor. */
var cursor = {};

View File

@@ -0,0 +1,5 @@
/** @member */
var x;
/** @var foobar */
/** @var {string} baz */

27
jsdoc-master/test/fixtures/mixintag.js vendored Normal file
View File

@@ -0,0 +1,27 @@
/**
* This provides methods used for event handling. It's not meant to
* be used directly, except as a provider of related methods.
*
* @mixin
*/
var Eventful = {
/** fires something. */
fires: function () {},
/** handles a signal. */
on: function () {}
};
/**
* @constructor
* @mixes Eventful
*/
var FormButton = function() {
};
/** @mixin AnotherMixin*/
/** I mix in multiple things
* @constructor MyClass
* @mixes Eventful
* @mixes AnotherMixin */

View File

@@ -0,0 +1,28 @@
/**
* @module my/module
*/
(function() {
/** document fooIn */
fooIn = function() {
};
/** @namespace */
bar = {
/** document bar.Zop */
zop: function() {
}
}
/** @constructor */
exports.Frotz = function() {
/** document exports.Frotz#quaz */
this.quaz = 1;
}
}) ();
/** document fooOut
*/
fooOut = function() {
};

View File

@@ -0,0 +1,17 @@
/**
Describe the module here.
@module mymodule/config
*/
/**
Create a new configuration
@param {string} id
@constructor
@alias module:mymodule/config
*/
function Config(id) {
/** Document me. */
this.id = id;
}
module.exports = Config;

View File

@@ -0,0 +1,10 @@
/**
* This is a module called foo.
* @module foo
*/
/**
* The module exports a single function.
* @param {string} bar
*/
module.exports = function(bar) {};

View File

@@ -0,0 +1,5 @@
/** @module */
define({
property: "foo",
method: function() {}
});

View File

@@ -0,0 +1,5 @@
/** @module my/module/name */
define({
property: "foo",
method: function() {}
});

View File

@@ -0,0 +1,21 @@
/**
My test module.
@module my/module
*/
define(function() {
/**
@undocumented
@alias module:my/module
*/
var mod = {
/** Document a property. */
myProperty: "foo",
/** Document a method. */
myMethod: function() {}
};
return mod;
});

11
jsdoc-master/test/fixtures/moduletag.js vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* @module bookshelf
*/
/**
* @class
*/
this.Book = function(title) {
/** document me */
this.title = title;
}

View File

@@ -0,0 +1,9 @@
/** @module color/mixer */
module.exports = {
/** Blend two colors together. */
blend: function(color1, color2) { }
}
/** Darken a color by the given shade. */
exports.darken = function(color, shade) { }

View File

@@ -0,0 +1,20 @@
/**
@module foo/Photo/manager
@desc Manage a collection of photos.
*/
/**
Construct a new Photo manager
@constructor module:foo/Photo/manager
@param {String} collectionId The identifier of the managed collection.
*/
module.exports = function(collectionId) {
/**
@function module:foo/Photo/manager#getPhoto
@param {String} photoName
*/
this.getPhoto = function() {}
}

View File

@@ -0,0 +1,7 @@
/** @class */
var Foo = function Bar(a) {
/** document me */
var var1 = 1;
/** document me */
this.member1 = 2;
};

View File

@@ -0,0 +1,7 @@
/** @class */
Foo = function Bar(a) {
/** document me */
var var1 = 1;
/** document me */
this.member1 = 2;
};

View File

@@ -0,0 +1,9 @@
ns = {
/** @class */
Foo: function Bar(a) {
/** document me */
var var1 = 1;
/** document me */
this.member1 = 2;
}
};

View File

@@ -0,0 +1,5 @@
/** @namespace */
var x = {
};
/** @namespace Foo */
/** @namespace {function} Bar */

View File

@@ -0,0 +1,8 @@
/** document me */
var tools = {
/** document me */
serialiser: {
/** document me */
value: ''
}
};

View File

@@ -0,0 +1,8 @@
/** document me */
var position = {
axis: {
/** document me */
x: 0,
y: 0
}
};

View File

@@ -0,0 +1,22 @@
Call(
{
methodA: function()
{
this.id = this.createUUID();
},
valueOf: function()
{
return this.id;
},
toString: function()
{
return this.id;
}
});
//Simple inheritance model with correct constructor
function Test() {}
function Test2() { Test.call(this); }
Test2.prototype = Object.create(Test.prototype, {constructor: {value: Test2}});

47
jsdoc-master/test/fixtures/paramtag.js vendored Normal file
View File

@@ -0,0 +1,47 @@
/**
* @param { String | Array<String>} targetName The name (or names) of what to find.
*/
function find(targetName) {
}
/**
* @param {function} callback
*/
function bind(callback) {
}
/**
* @param {function}
*/
function unbind(callback) {
}
/**
* @param id The id of the element.
*/
function getElement(id) {
}
/**
* @param ... Two or more elements.
*/
function combine() {
}
/**
* @param delimiter - What to split on.
*/
function split(delimiter) {
}
/**
* @param - If true make the commit atomic.
*/
function commit(atomic) {
}
/**
* @param [async=true] - whether to be asynchronous
*/
function request(async) {
}

10
jsdoc-master/test/fixtures/plugins.js vendored Normal file
View File

@@ -0,0 +1,10 @@
/**
* @name virtual
*/
var foo = "bar";
/**
* @foo bar
*/
var test = "tada";

View File

@@ -0,0 +1,11 @@
/**
* @constructor
* @private
*/
function Foo() {
/** document me */
this.bar = 1;
}

View File

@@ -0,0 +1,9 @@
/**
An automated documentation generator for JavaScript.
@project JSDoc
@version 3.0.0
@copyright 2011 (c) Michael Mathews <micmath@gmail.com>
@license Apache Version 2 <http://www.apache.org/licenses/LICENSE-2.0>
*/
function blah(url) {
}

View File

@@ -0,0 +1,13 @@
/**
* @namespace
* @property {Object} defaults The default values.
* @property {Number} defaults.a The a property of the defaults.
* @property {String} defaults.b The b property of the defaults.
*/
myobject = {
defaults: {
a: 1,
b: "Hit the light",
c: true
}
};

19
jsdoc-master/test/fixtures/quotename.js vendored Normal file
View File

@@ -0,0 +1,19 @@
/** @namespace */
var chat = {};
/**
@namespace
*/
chat["#channel"] = {};
/**
@member
@type {boolean}
@defaultvalue
*/
chat["#channel"].open = true;
/**
@event chat."#channel"."op:announce-motd"
*/

View File

@@ -0,0 +1,10 @@
/** @namespace */
var contacts = {
/** @namespace */
'say-"hello"@example.com': {
/** document me */
"username": 'Sue Smart'
}
}

View File

@@ -0,0 +1,10 @@
/**
* @constructor
*/
function Collection() {
/** @readonly */
this.length = 0;
}

View File

@@ -0,0 +1,12 @@
/**
* @requires module:foo/helper
*/
function foo() {
}
/**
* @requires foo
* @requires Pez#blat this text is ignored
*/
function bar() {
}

Some files were not shown because too many files have changed in this diff Show More