Skip to content

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
hegemonic committed Mar 3, 2014
1 parent dda4e00 commit 0a05ede
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 58 deletions.
12 changes: 6 additions & 6 deletions lib/jsdoc/borrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
A collection of functions relating to resolving @borrows tags in JSDoc symbols.
@module jsdoc/borrow
@author Michael Mathews <[email protected]>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';

Expand Down Expand Up @@ -35,20 +35,20 @@ exports.resolveBorrows = function(docs) {
logger.error('Unable to resolve borrowed symbols, because the docs have not been indexed.');
return;
}

docs.forEach(function(doc) {
if (doc.borrowed) {
doc.borrowed.forEach(function(b, i) {
var lent = docs.index[b.from], // lent is an array
asName = b.as || b.from;

if (lent) {
var cloned = doop(lent);

cloned.forEach(function(clone) {
asName = asName.replace(/^prototype\./, '#');
var parts = asName.split('#');

if (parts.length === 2) { clone.scope = 'instance'; }
else { clone.scope = 'static'; }

Expand All @@ -58,10 +58,10 @@ exports.resolveBorrows = function(docs) {
clone.longname = clone.memberof + (clone.scope === 'instance'? '#': '.') + clone.name;
docs.push(clone);
});

}
});

delete doc.borrowed;
}
});
Expand Down
6 changes: 3 additions & 3 deletions lib/jsdoc/config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
@overview
@author Michael Mathews <[email protected]>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/

/**
@module jsdoc/config
@module jsdoc/config
*/
'use strict';

Expand All @@ -19,7 +19,7 @@ function mergeRecurse(target, source) {
target[p] = source[p];
}
});

return target;
}

Expand Down
34 changes: 17 additions & 17 deletions lib/jsdoc/name.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@module jsdoc/name
@requires jsdoc/tag/dictionary
@author Michael Mathews <[email protected]>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';

Expand Down Expand Up @@ -53,15 +53,15 @@ exports.resolve = function(doclet) {
name = name.replace(/(?:^|\.)prototype\.?/g, INSTANCE);
}
doclet.name = name;

// member of a var in an outer scope?
if (name && !memberof && doclet.meta.code && doclet.meta.code.funcscope) {
name = doclet.longname = doclet.meta.code.funcscope + INNER + name;
}

if (memberof || doclet.forceMemberof) { // @memberof tag given
memberof = ('' || memberof).replace(/\.prototype\.?/g, INSTANCE);

// the name is a fullname, like @name foo.bar, @memberof foo
if (name && name.indexOf(memberof) === 0 && name !== memberof) {
about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined));
Expand Down Expand Up @@ -89,19 +89,19 @@ exports.resolve = function(doclet) {
else { // no @memberof
about = exports.shorten(name);
}

if (about.name) {
doclet.name = about.name;
}

if (about.memberof) {
doclet.setMemberof(about.memberof);
}

if (about.longname && !doclet.longname) {
doclet.setLongname(about.longname);
}

if (doclet.scope === 'global') { // via @global tag?
doclet.setLongname(doclet.name);
delete doclet.memberof;
Expand Down Expand Up @@ -146,7 +146,7 @@ function quoteUnsafe(name, kind) { // docspaced names may have unsafe characters
return '"' + name.replace(/\"/g, '"') + '"';
}
}

return name;
}

Expand All @@ -170,7 +170,7 @@ exports.applyNamespace = function(longname, ns) {
if ( !/^[a-zA-Z]+?:.+$/i.test(name) ) {
longname = longname.replace( new RegExp(RegExp.escape(name)+'$'), ns + ':' + name );
}

return longname;
};

Expand All @@ -184,29 +184,29 @@ exports.applyNamespace = function(longname, ns) {
exports.shorten = function(longname, forcedMemberof) {
// quoted strings in a longname are atomic, convert to tokens
var atoms = [], token;

// handle quoted names like foo["bar"] or foo['bar']
longname = longname.replace(/(\[?["'].+?["']\]?)/g, function($) {
var dot = '';
if ( /^\[/.test($) ) {
dot = '.';
$ = $.replace( /^\[/g, '' ).replace( /\]$/g, '' );
}

token = '@{' + atoms.length + '}@';
atoms.push($);

return dot + token; // foo["bar"] => foo.@{1}@
});

var name = '',
scope = '', // ., ~, or #
memberof = '',
parts,
variation;

longname = longname.replace(/\.prototype\.?/g, INSTANCE);

if (typeof forcedMemberof !== 'undefined') {
name = longname.substr(forcedMemberof.length);
parts = forcedMemberof.match(/^(.*?)([#.~]?)$/);
Expand All @@ -218,18 +218,18 @@ exports.shorten = function(longname, forcedMemberof) {
parts = longname?
(longname.match( /^(:?(.+)([#.~]))?(.+?)$/ ) || []).reverse()
: [''];

name = parts[0] || ''; // ensure name is always initialised to avoid error being thrown when calling replace on undefined [gh-24]
scope = parts[1] || ''; // ., ~, or #
memberof = parts[2] || '';
}

// like /** @name foo.bar(2) */
if ( /(.+)\(([^)]+)\)$/.test(name) ) {
name = RegExp.$1;
variation = RegExp.$2;
}

//// restore quoted strings back again
var i = atoms.length;
while (i--) {
Expand Down
20 changes: 10 additions & 10 deletions lib/jsdoc/package.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
@overview
@author Michael Mathews <[email protected]>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';

/**
@module jsdoc/package
@see http://wiki.commonjs.org/wiki/Packages/1.0
@module jsdoc/package
@see http://wiki.commonjs.org/wiki/Packages/1.0
*/

/**
Expand All @@ -22,39 +22,39 @@ exports.Package = function(json) {
@type {Array<String>}
*/
this.files = [];

/** The kind of this package.
@readonly
@default
@type {string}
*/
this.kind = 'package';

json = JSON.parse(json);

/** The name of this package.
This value is found in the package.json file passed in as a command line option.
@type {string}
*/
this.name = json.name;

/** The longname of this package.
@type {string}
*/
this.longname = this.kind + ':' + this.name;

/** The description of this package.
@type {string}
*/
this.description = json.description;

/**
The hash summary of the source file.
@type {string}
@since 3.2.0
*/
this.version = json.version;

/**
* The licenses of this package.
* @type {Array<Object>}
Expand Down
4 changes: 2 additions & 2 deletions lib/jsdoc/readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'use strict';

var fs = require('jsdoc/fs'),
markdown = require('jsdoc/util/markdown');
markdown = require('jsdoc/util/markdown');

/**
* @class
Expand All @@ -19,7 +19,7 @@ var fs = require('jsdoc/fs'),
function ReadMe(path) {
var content = fs.readFileSync(path, env.opts.encoding),
parse = markdown.getParser();

this.html = parse(content);
}

Expand Down
26 changes: 13 additions & 13 deletions lib/jsdoc/tag/dictionary.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
@overview
@author Michael Mathews <[email protected]>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
@overview
@author Michael Mathews <[email protected]>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';

Expand All @@ -17,9 +17,9 @@ var dictionary;
function TagDefinition(title, etc) {
var self = this;
etc = etc || {};

this.title = dictionary.normalise(title);

Object.keys(etc).forEach(function(p) {
self[p] = etc[p];
});
Expand All @@ -38,22 +38,22 @@ dictionary = {
var def = new TagDefinition(title, opts);
// all the other dictionary functions use normalised names; we should too.
_tags[def.title] = def;

if (opts.isNamespace) {
_namespaces.push(def.title);
}

return _tags[def.title];
},

/** @function */
lookUp: function(title) {
title = dictionary.normalise(title);

if ( hasOwnProp.call(_tags, title) ) {
return _tags[title];
}

return false;
},

Expand All @@ -65,18 +65,18 @@ dictionary = {
return true;
}
}

return false;
},

/** @function */
normalise: function(title) {
var canonicalName = title.toLowerCase();

if ( hasOwnProp.call(_tagSynonyms, canonicalName) ) {
return _tagSynonyms[canonicalName];
}

return canonicalName;
}
};
Expand Down
8 changes: 4 additions & 4 deletions lib/jsdoc/tag/validator.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*global env: true */
/**
@module jsdoc/tag/validator
@requires jsdoc/tag/dictionary
@module jsdoc/tag/validator
@requires jsdoc/tag/dictionary
@author Michael Mathews <[email protected]>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
@author Michael Mathews <[email protected]>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';

Expand Down
6 changes: 3 additions & 3 deletions rhino/jsdoc/src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ exports.createParser = require('jsdoc/src/parser').createParser;

// TODO: docs
var Parser = exports.Parser = function() {
var astBuilder;
var visitor;
var astBuilder;
var visitor;

var runtime = require('jsdoc/util/runtime');
var runtime = require('jsdoc/util/runtime');
if ( !runtime.isRhino() ) {
throw new Error('You must run JSDoc on Mozilla Rhino to use the Rhino parser.');
}
Expand Down

0 comments on commit 0a05ede

Please sign in to comment.