Merge branch 'master' into feature-listens

This commit is contained in:
mathematicalcoffee 2013-03-18 12:48:04 +10:00
commit a789bc3187
4 changed files with 66 additions and 38 deletions

View File

@ -13,7 +13,7 @@
"regexp": false,
"undef": true,
"strict": false,
"trailing": true,
"trailing": false,
"asi": false,
"boss": false,

View File

@ -2,6 +2,19 @@
This file describes notable changes in each version of JSDoc 3. To download a specific version of JSDoc 3, see [GitHub's tags page](https://github.com/jsdoc3/jsdoc/tags).
## 3.1.1 (February 2013)
+ Resolved a crash when no input files contain JSDoc comments. (#329)
+ Resolved a crash when JSDoc cannot identify the common prefix of several paths. (#330)
+ Resolved a crash when the full path to JSDoc contained at least one space. (#347)
+ Files named `README.md` or `package.json` will now be processed when they are specified on the command line. (#350)
+ You can now use `@emits` as a synonym for `@fires`. (#324)
+ The module `jsdoc/util/templateHelper` now allows you to specify the CSS class for links that are generated by the following methods: (#331)
+ `getAncestorLinks`
+ `getSignatureReturns`
+ `getSignatureTypes`
+ `linkto`
## 3.1.0 (January 2013)

View File

@ -9,47 +9,64 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
/** Data representing the environment in which this app is running.
@namespace
*/
env = {
/** Running start and finish times. */
/**
* Data representing the environment in which this app is running.
*
* @namespace
* @name env
*/
require('lib/jsdoc/util/global').env = {
/**
* Running start and finish times.
*
* @memberof env
*/
run: {
start: new Date(),
finish: null
},
/**
The command line arguments passed into jsdoc.
@type Array
*/
* The command-line arguments passed into JSDoc.
*
* @type Array
* @memberof env
*/
args: [],
/**
The parsed JSON data from the configuration file.
@type Object
*/
* The parsed JSON data from the configuration file.
*
* @type Object
* @memberof env
*/
conf: {},
/**
The absolute path to the base directory of the jsdoc application.
@private
@deprecated Use `__dirname` instead.
@type string
*/
* The absolute path to the base directory of the JSDoc application.
*
* @private
* @deprecated Use `__dirname` instead.
* @type string
* @memberof env
*/
dirname: '.',
/**
The command line arguments, parsed into a key/value hash.
@type Object
@example if (env.opts.help) { console.log('Helpful message.'); }
* The command-line arguments, parsed into a key/value hash.
*
* @type Object
* @memberof env
* @example if (env.opts.help) { console.log('Helpful message.'); }
*/
opts: {},
/**
The jsdoc version number and revision date.
@type Object
*/
* The JSDoc version number and revision date.
*
* @type Object
* @memberof env
*/
version: {}
};
@ -65,8 +82,9 @@ env = {
/**
* Data that must be shared across the entire application.
* @namespace
* @name app
*/
app = {
require('lib/jsdoc/util/global').app = {
jsdoc: {
scanner: new (require('jsdoc/src/scanner').Scanner)(),
parser: new (require('jsdoc/src/parser').Parser)(),

View File

@ -1,4 +1,5 @@
/*global afterEach: true, beforeEach: true, describe: true, expect: true, env: true, it: true, xdescribe: true */
/*global afterEach: true, beforeEach: true, describe: true, expect: true, env: true, it: true,
spyOn: true, xdescribe: true */
var hasOwnProp = Object.prototype.hasOwnProperty;
describe("jsdoc/util/templateHelper", function() {
@ -129,7 +130,7 @@ describe("jsdoc/util/templateHelper", function() {
// bit of a dodgy test but the best I can manage. setTutorials doesn't do much.
helper.setTutorials(null);
// should throw error: no 'getByName' in tutorials.
expect(function () { return helper.tutorialToUrl('asdf') }).toThrow('Cannot call method "getByName" of null');
expect(function () { return helper.tutorialToUrl('asdf'); }).toThrow('Cannot call method "getByName" of null');
});
it("setting tutorials to the root tutorial object lets lookups work", function() {
@ -766,23 +767,23 @@ describe("jsdoc/util/templateHelper", function() {
});
it('should prune private members if env.opts.private is falsy', function() {
var priv = !!env.opts['private'];
var priv = !!env.opts.private;
env.opts['private'] = false;
env.opts.private = false;
var pruned = helper.prune( taffy(arrayPrivate) )().get();
compareObjectArrays([], pruned);
env.opts['private'] = !!priv;
env.opts.private = !!priv;
});
it('should not prune private members if env.opts.private is truthy', function() {
var priv = !!env.opts['private'];
var priv = !!env.opts.private;
env.opts['private'] = true;
env.opts.private = true;
var pruned = helper.prune( taffy(arrayPrivate) )().get();
compareObjectArrays(arrayPrivate, pruned);
env.opts['private'] = !!priv;
env.opts.private = !!priv;
});
});
@ -806,8 +807,6 @@ describe("jsdoc/util/templateHelper", function() {
});
describe("tutorialToUrl", function() {
/*jshint evil: true */
var lenient = !!env.opts.lenient;
function missingTutorial() {
@ -837,7 +836,7 @@ describe("jsdoc/util/templateHelper", function() {
it("does not return a tutorial if its name is a reserved JS keyword and it doesn't exist", function() {
env.opts.lenient = false;
expect(function () { helper.tutorialToUrl('prototype') }).toThrow();
expect(function () { helper.tutorialToUrl('prototype'); }).toThrow();
});
it("creates links to tutorials if they exist", function() {
@ -866,9 +865,7 @@ describe("jsdoc/util/templateHelper", function() {
});
});
describe("toTutorial", function() {
/*jshint evil: true */
xdescribe("toTutorial", function() {
var lenient = !!env.opts.lenient;
function missingParam() {