'use strict'ify

This commit is contained in:
Jeff Williams 2013-11-11 23:49:54 -08:00
parent 3716df0e23
commit f55feb1a0e
65 changed files with 98 additions and 24 deletions

1
cli.js
View File

@ -12,6 +12,7 @@
* @private
*/
module.exports = (function() {
'use strict';
var props = {
docs: [],

View File

@ -124,6 +124,8 @@ global.dump = function() {
};
(function() {
'use strict';
function cb(errorCode) {
process.exit(errorCode || 0);
}

View File

@ -1,3 +1,5 @@
'use strict';
var hasOwnProp = Object.prototype.hasOwnProperty;
function mapDependencies(index) {

View File

@ -4,6 +4,7 @@
@author Michael Mathews <micmath@gmail.com>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var doop = require("jsdoc/util/doop").doop;

View File

@ -7,6 +7,7 @@
/**
@module jsdoc/config
*/
'use strict';
function mergeRecurse(target, source) {
Object.keys(source).forEach(function(p) {
@ -23,7 +24,7 @@ function mergeRecurse(target, source) {
}
// required config values, override these defaults in your config.json if necessary
const defaults = {
var defaults = {
"tags": {
"allowUnknownTags": true
},

View File

@ -7,6 +7,7 @@
/**
* @module jsdoc/doclet
*/
'use strict';
var _ = require('underscore');
var jsdoc = {
@ -33,21 +34,21 @@ exports.GLOBAL_LONGNAME = '<global>';
exports.UNDOCUMENTED_TAG = '@undocumented';
function applyTag(tag) {
function applyTag(doclet, tag) {
if (tag.title === 'name') {
this.name = tag.value;
doclet.name = tag.value;
}
if (tag.title === 'kind') {
this.kind = tag.value;
doclet.kind = tag.value;
}
if (tag.title === 'description') {
this.description = tag.value;
doclet.description = tag.value;
}
if (tag.title === 'scope') {
this.scope = tag.value;
doclet.scope = tag.value;
}
}
@ -212,7 +213,7 @@ Doclet.prototype.addTag = function(title, text) {
this.tags.push(newTag);
}
applyTag.call(this, newTag);
applyTag(this, newTag);
};
function removeGlobal(longname) {

View File

@ -2,6 +2,8 @@
* Extended version of the standard `fs` module.
* @module jsdoc/fs
*/
'use strict';
var fs = require('fs');
var path = require('path');
var runtime = require('jsdoc/util/runtime');

View File

@ -5,6 +5,7 @@
@author Michael Mathews <micmath@gmail.com>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var _ = require('underscore');
var jsdoc = {

View File

@ -4,6 +4,7 @@
@author Michael Mathews <micmath@gmail.com>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var _ = require('underscore');

View File

@ -4,6 +4,7 @@
@author Michael Mathews <micmath@gmail.com>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var ArgParser = require('jsdoc/opts/argparser'),
argParser = new ArgParser(),

View File

@ -3,6 +3,7 @@
@author Michael Mathews <micmath@gmail.com>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
/**
@module jsdoc/package

View File

@ -3,6 +3,7 @@
* Extended version of the standard `path` module.
* @module jsdoc/path
*/
'use strict';
var fs = require('fs');
var path = require('path');

View File

@ -3,6 +3,7 @@
* Utility functions to support the JSDoc plugin framework.
* @module jsdoc/plugins
*/
'use strict';
var error = require('jsdoc/util/error');
var path = require('jsdoc/path');

View File

@ -6,6 +6,7 @@
* @author Michael Mathews <micmath@gmail.com>
* @author Ben Blank <ben.blank@gmail.com>
*/
'use strict';
var fs = require('jsdoc/fs'),
markdown = require('jsdoc/util/markdown');

View File

@ -4,6 +4,7 @@
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
@see <http://tools.ietf.org/html/draft-zyp-json-schema-02>
*/
'use strict';
exports.jsdocSchema = {
"properties": {

View File

@ -1,3 +1,5 @@
'use strict';
var Syntax = require('jsdoc/src/syntax').Syntax;
// TODO: should set e.stopPropagation == true for consistency with Rhino, right?

View File

@ -5,6 +5,7 @@
@author Michael Mathews <micmath@gmail.com>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var path = require('jsdoc/path');

View File

@ -1,7 +1,7 @@
/**
* @module jsdoc/src/handlers
*/
'use strict';
var currentModule = null;
@ -46,7 +46,7 @@ exports.attachTo = function(parser) {
return false; // only interested in virtual comments (with a @name) here
}
addDoclet.call(this, newDoclet);
addDoclet.call(parser, newDoclet);
e.doclet = newDoclet;
});
@ -56,7 +56,7 @@ exports.attachTo = function(parser) {
var subDoclets = e.comment.split(/@also\b/g);
for (var i = 0, l = subDoclets.length; i < l; i++) {
newSymbolDoclet.call(this, subDoclets[i], e);
newSymbolDoclet.call(parser, subDoclets[i], e);
}
});
@ -74,7 +74,7 @@ exports.attachTo = function(parser) {
if (newDoclet.alias) {
if (newDoclet.alias === '{@thisClass}') {
memberofName = this.resolveThis(e.astnode);
memberofName = parser.resolveThis(e.astnode);
// "class" refers to the owner of the prototype, not the prototype itself
if ( /^(.+?)(\.prototype|#)$/.test(memberofName) ) {
@ -107,7 +107,7 @@ exports.attachTo = function(parser) {
else {
// like /** @module foo */ exports = {bar: 1};
// or /** blah */ this.foo = 1;
memberofName = this.resolveThis(e.astnode);
memberofName = parser.resolveThis(e.astnode);
scope = nameStartsWith === 'exports'? 'static' : 'instance';
// like /** @module foo */ this.bar = 1;
@ -125,7 +125,7 @@ exports.attachTo = function(parser) {
}
}
else {
memberofName = this.astnodeToMemberof(e.astnode);
memberofName = parser.astnodeToMemberof(e.astnode);
if( Array.isArray(memberofName) ) {
basename = memberofName[1];
memberofName = memberofName[0];
@ -166,7 +166,7 @@ exports.attachTo = function(parser) {
newDoclet.scope = 'global';
}
addDoclet.call(this, newDoclet);
addDoclet.call(parser, newDoclet);
e.doclet = newDoclet;
}
@ -179,10 +179,10 @@ exports.attachTo = function(parser) {
if (newDoclet) {
setCurrentModule(newDoclet);
e = { doclet: newDoclet };
this.emit('newDoclet', e);
parser.emit('newDoclet', e);
if ( !e.defaultPrevented && !filter(newDoclet) ) {
this.addResult(newDoclet);
parser.addResult(newDoclet);
}
}
}

View File

@ -2,6 +2,7 @@
/**
* @module jsdoc/src/parser
*/
'use strict';
var Doclet = require('jsdoc/doclet');
var name = require('jsdoc/name');

View File

@ -6,7 +6,7 @@
@author Michael Mathews <micmath@gmail.com>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var fs = require('jsdoc/fs');
var path = require('jsdoc/path');

View File

@ -1,3 +1,5 @@
'use strict';
// TODO: docs
exports.Syntax = {
ArrayExpression: 'ArrayExpression',

View File

@ -1,6 +1,7 @@
/**
* @module jsdoc/src/visitor
*/
'use strict';
// TODO: consider exporting more stuff so users can override it

View File

@ -5,6 +5,7 @@
* @module jsdoc/src/walker
* @license MIT
*/
'use strict';
var Syntax = require('jsdoc/src/syntax').Syntax;

View File

@ -12,6 +12,7 @@
@requires jsdoc/tag/validator
@requires jsdoc/tag/type
*/
'use strict';
var jsdoc = {
tag: {

View File

@ -3,6 +3,7 @@
@author Michael Mathews <micmath@gmail.com>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var hasOwnProp = Object.prototype.hasOwnProperty;

View File

@ -6,6 +6,7 @@
@author Michael Mathews <micmath@gmail.com>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var path = require('jsdoc/path');
var Syntax = require('jsdoc/src/syntax').Syntax;

View File

@ -4,6 +4,7 @@
* @author Jeff Williams <jeffrey.l.williams@gmail.com>
* @license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
/**
* Information about an inline tag that was found within a string.
@ -94,7 +95,7 @@ exports.replaceInlineTags = function(string, replacers) {
};
tagInfo.push(matchedTag);
return replacer.call(this, string, matchedTag);
return replacer(string, matchedTag);
}
string = string || '';

View File

@ -5,6 +5,7 @@
* @author Jeff Williams <jeffrey.l.williams@gmail.com>
* @license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var jsdoc = {
name: require('jsdoc/name'),

View File

@ -6,7 +6,7 @@
@author Michael Mathews <micmath@gmail.com>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var dictionary = require('jsdoc/tag/dictionary');
var format = require('util').format;

View File

@ -4,6 +4,7 @@
* @author <a href="mailto:matthewkastor@gmail.com">Matthew Christopher Kastor-Inare III</a>
* @license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var _ = require('underscore'),
fs = require('jsdoc/fs'),

View File

@ -3,6 +3,7 @@
@author Rafał Wrzeszcz <rafal.wrzeszcz@wrzasq.pl>
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var markdown = require('jsdoc/util/markdown');

View File

@ -8,6 +8,7 @@
/**
@module jsdoc/tutorial/resolver
*/
'use strict';
var tutorial = require('jsdoc/tutorial'),
fs = require('jsdoc/fs'),

View File

@ -2,6 +2,8 @@
Deep clone a simple object.
@private
*/
'use strict';
function doop(o) {
var clone;
var props;

View File

@ -4,6 +4,7 @@
* @author Michael Mathews <micmath@gmail.com>
* @license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
'use strict';
var util = require('util');
@ -36,7 +37,7 @@ function checkCircularRefs(o, func) {
}
else {
seenItems.push(o);
return func.call(this, o);
return func(o);
}
}

View File

@ -3,6 +3,7 @@
Helper functions for handling errors.
@module jsdoc/util/error
*/
'use strict';
/**
Handle an exception appropriately based on whether lenient mode is enabled:

View File

@ -6,6 +6,7 @@
* @author Michael Mathews <micmath@gmail.com>
* @author Ben Blank <ben.blank@gmail.com>
*/
'use strict';
/**
* Enumeration of Markdown parsers that are available.

View File

@ -5,6 +5,7 @@
* @module jsdoc/util/runtime
* @private
*/
'use strict';
var os = require('os');

View File

@ -2,6 +2,7 @@
/**
* @module jsdoc/util/templateHelper
*/
'use strict';
var dictionary = require('jsdoc/tag/dictionary');
var util = require('util');

View File

@ -1,3 +1,5 @@
'use strict';
var fs = require('fs');
var path = require('path');
var stream = require('stream');

View File

@ -1,3 +1,5 @@
'use strict';
exports.pathToUri = function(_path) {
return _path;
};

View File

@ -1,5 +1,7 @@
#!/usr/bin/env node
'use strict';
var fs = require('fs');
var path = require('path');

View File

@ -3,7 +3,7 @@
@module plugins/commentConvert
@author Michael Mathews <micmath@gmail.com>
*/
'use strict';
exports.handlers = {
///

View File

@ -5,6 +5,7 @@
* @module plugins/commentsOnly
* @author Jeff Williams <jeffrey.l.williams@gmail.com>
*/
'use strict';
exports.handlers = {
beforeParse: function(e) {

View File

@ -3,7 +3,7 @@
@module plugins/escapeHtml
@author Michael Mathews <micmath@gmail.com>
*/
'use strict';
exports.handlers = {
/**

View File

@ -4,6 +4,7 @@
* @module plugins/eventDumper
* @author Jeff Williams <jeffrey.l.williams@gmail.com>
*/
'use strict';
var _ = require('underscore');
var util = require('util');

View File

@ -5,6 +5,8 @@
* @author Michael Mathews <micmath@gmail.com>
* @author Ben Blank <ben.blank@gmail.com>
*/
'use strict';
var conf = env.conf.markdown;
var defaultTags = [ "classdesc", "description", "params", "properties", "returns", "see"];
var hasOwnProp = Object.prototype.hasOwnProperty;

View File

@ -36,6 +36,7 @@
* @author Jeff Williams <jeffrey.l.williams@gmail.com>
* @license Apache License 2.0
*/
'use strict';
// lookup table of function doclets by longname
var functionDoclets;

View File

@ -4,6 +4,7 @@
@module plugins/partial
@author Ludo Antonov <ludo@hulu.com>
*/
'use strict';
var fs = require('jsdoc/fs');
var path = require('path');

View File

@ -3,7 +3,7 @@
@module plugins/railsTemplate
@author Jannon Frank <jannon@jannon.net>
*/
'use strict';
exports.handlers = {
/**

View File

@ -3,6 +3,7 @@
@module plugins/shout
@author Michael Mathews <micmath@gmail.com>
*/
'use strict';
exports.handlers = {
/**

View File

@ -2,6 +2,7 @@
@module plugins/sourcetag
@author Michael Mathews <micmath@gmail.com>
*/
'use strict';
exports.handlers = {
/**

View File

@ -4,6 +4,7 @@
* @author Rob Taylor <manix84@gmail.com> - The basic idea
* @author Michael Mathews <micmath@gmail.com> - Wrote the first itteration with me :)
*/
'use strict';
exports.handlers = {
/**

View File

@ -1 +1,3 @@
'use strict';
module.exports = require('crypto-browserify');

View File

@ -3,6 +3,7 @@
* @see https://github.com/substack/node-browserify
* @license MIT
*/
'use strict';
if (!process.EventEmitter) {
process.EventEmitter = function () {};

View File

@ -4,6 +4,7 @@
* Partial Rhino shim for Node.js' `fs` module.
* @see http://nodejs.org/api/fs.html
*/
'use strict';
var path = require('path');
var util = require('util');

View File

@ -1,4 +1,5 @@
// Platform-specific functions to support jsdoc.js
'use strict';
exports.pathToUri = function(_path) {
return String( new java.io.File(_path).toURI() );

View File

@ -3,6 +3,7 @@
* Creates an Esprima-compatible AST using Rhino's JavaScript parser.
* @module rhino/jsdoc/src/astbuilder
*/
'use strict';
var AstBuilder = exports.AstBuilder = function() {
this._builder = new Packages.org.jsdoc.AstBuilder();

View File

@ -1,4 +1,5 @@
// TODO: module docs
'use strict';
// TODO: docs
exports.createParser = require('jsdoc/src/parser').createParser;

View File

@ -1,4 +1,5 @@
// TODO: module docs
'use strict';
// TODO: docs
var Visitor = exports.Visitor = function(parser) {

View File

@ -4,6 +4,7 @@
* @author Jeff Williams <jeffrey.l.williams@gmail.com>
* @see http://nodejs.org/api/os.html
*/
'use strict';
exports.EOL = String( java.lang.System.getProperty('line.separator') );

View File

@ -1,3 +1,5 @@
'use strict';
var isWindows = java.lang.System.getProperty("os.name").toLowerCase().contains("windows");
var fileSeparator = exports.sep = String( java.lang.System.getProperty("file.separator") );

View File

@ -5,6 +5,8 @@
* @see https://github.com/joyent/node/blob/f105f2f2/lib/querystring.js
* @license MIT
*/
'use strict';
var QueryString = exports;
// If obj.hasOwnProperty has been overridden, then calling

View File

@ -18,6 +18,8 @@ global.setInterval = null;
global.clearInterval = null;
(function() {
'use strict';
// TODO: tune number of threads if necessary
var timerPool = new java.util.concurrent.ScheduledThreadPoolExecutor(10);
var timers = {};

View File

@ -1,4 +1,6 @@
/*global env: true */
'use strict';
var template = require('jsdoc/template'),
fs = require('jsdoc/fs'),
path = require('jsdoc/path'),

View File

@ -4,6 +4,7 @@
@example
./jsdoc scratch/jsdoc_test.js -t templates/haruki -d console -q format=xml
*/
'use strict';
function graft(parentNode, childNodes, parentLongname, parentName) {
childNodes
@ -210,7 +211,7 @@ exports.publish = function(data, opts) {
console.log( xml('jsdoc', root) );
}
else {
dump(root);
global.dump(root);
}
}
else {