From f55feb1a0e5cf8bd3ffa8e94a6ec6c66e21378de Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Mon, 11 Nov 2013 23:49:54 -0800 Subject: [PATCH] 'use strict'ify --- cli.js | 1 + jsdoc.js | 2 ++ lib/jsdoc/augment.js | 2 ++ lib/jsdoc/borrow.js | 1 + lib/jsdoc/config.js | 3 ++- lib/jsdoc/doclet.js | 13 +++++++------ lib/jsdoc/fs.js | 2 ++ lib/jsdoc/name.js | 1 + lib/jsdoc/opts/argparser.js | 1 + lib/jsdoc/opts/args.js | 1 + lib/jsdoc/package.js | 1 + lib/jsdoc/path.js | 1 + lib/jsdoc/plugins.js | 1 + lib/jsdoc/readme.js | 1 + lib/jsdoc/schema.js | 1 + lib/jsdoc/src/astbuilder.js | 2 ++ lib/jsdoc/src/filter.js | 1 + lib/jsdoc/src/handlers.js | 18 +++++++++--------- lib/jsdoc/src/parser.js | 1 + lib/jsdoc/src/scanner.js | 2 +- lib/jsdoc/src/syntax.js | 2 ++ lib/jsdoc/src/visitor.js | 1 + lib/jsdoc/src/walker.js | 1 + lib/jsdoc/tag.js | 1 + lib/jsdoc/tag/dictionary.js | 1 + lib/jsdoc/tag/dictionary/definitions.js | 1 + lib/jsdoc/tag/inline.js | 3 ++- lib/jsdoc/tag/type.js | 1 + lib/jsdoc/tag/validator.js | 2 +- lib/jsdoc/template.js | 1 + lib/jsdoc/tutorial.js | 1 + lib/jsdoc/tutorial/resolver.js | 1 + lib/jsdoc/util/doop.js | 2 ++ lib/jsdoc/util/dumper.js | 3 ++- lib/jsdoc/util/error.js | 1 + lib/jsdoc/util/markdown.js | 1 + lib/jsdoc/util/runtime.js | 1 + lib/jsdoc/util/templateHelper.js | 1 + node/fs.js | 2 ++ node/path.js | 2 ++ node/postinstall.js | 2 ++ plugins/commentConvert.js | 2 +- plugins/commentsOnly.js | 1 + plugins/escapeHtml.js | 2 +- plugins/eventDumper.js | 1 + plugins/markdown.js | 2 ++ plugins/overloadHelper.js | 1 + plugins/partial.js | 1 + plugins/railsTemplate.js | 2 +- plugins/shout.js | 1 + plugins/sourcetag.js | 1 + plugins/verboseOutput.js | 1 + rhino/crypto.js | 2 ++ rhino/events.js | 1 + rhino/fs.js | 1 + rhino/jsdoc.js | 1 + rhino/jsdoc/src/astbuilder.js | 1 + rhino/jsdoc/src/parser.js | 1 + rhino/jsdoc/src/visitor.js | 1 + rhino/os.js | 1 + rhino/path.js | 2 ++ rhino/querystring.js | 2 ++ rhino/rhino-shim.js | 2 ++ templates/default/publish.js | 2 ++ templates/haruki/publish.js | 3 ++- 65 files changed, 98 insertions(+), 24 deletions(-) diff --git a/cli.js b/cli.js index 4cb4869b..100c4096 100644 --- a/cli.js +++ b/cli.js @@ -12,6 +12,7 @@ * @private */ module.exports = (function() { +'use strict'; var props = { docs: [], diff --git a/jsdoc.js b/jsdoc.js index 3e463809..4c9a6e27 100755 --- a/jsdoc.js +++ b/jsdoc.js @@ -124,6 +124,8 @@ global.dump = function() { }; (function() { + 'use strict'; + function cb(errorCode) { process.exit(errorCode || 0); } diff --git a/lib/jsdoc/augment.js b/lib/jsdoc/augment.js index 614fd314..d22ca359 100644 --- a/lib/jsdoc/augment.js +++ b/lib/jsdoc/augment.js @@ -1,3 +1,5 @@ +'use strict'; + var hasOwnProp = Object.prototype.hasOwnProperty; function mapDependencies(index) { diff --git a/lib/jsdoc/borrow.js b/lib/jsdoc/borrow.js index 5cc13ca5..7c3d438f 100644 --- a/lib/jsdoc/borrow.js +++ b/lib/jsdoc/borrow.js @@ -4,6 +4,7 @@ @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var doop = require("jsdoc/util/doop").doop; diff --git a/lib/jsdoc/config.js b/lib/jsdoc/config.js index 8119cbbf..7f55883a 100644 --- a/lib/jsdoc/config.js +++ b/lib/jsdoc/config.js @@ -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 }, diff --git a/lib/jsdoc/doclet.js b/lib/jsdoc/doclet.js index c3a12d48..e436dd88 100644 --- a/lib/jsdoc/doclet.js +++ b/lib/jsdoc/doclet.js @@ -7,6 +7,7 @@ /** * @module jsdoc/doclet */ +'use strict'; var _ = require('underscore'); var jsdoc = { @@ -33,21 +34,21 @@ exports.GLOBAL_LONGNAME = ''; 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) { diff --git a/lib/jsdoc/fs.js b/lib/jsdoc/fs.js index 00cbcd90..4bb8966e 100644 --- a/lib/jsdoc/fs.js +++ b/lib/jsdoc/fs.js @@ -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'); diff --git a/lib/jsdoc/name.js b/lib/jsdoc/name.js index e18b57cc..5ba18a05 100644 --- a/lib/jsdoc/name.js +++ b/lib/jsdoc/name.js @@ -5,6 +5,7 @@ @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var _ = require('underscore'); var jsdoc = { diff --git a/lib/jsdoc/opts/argparser.js b/lib/jsdoc/opts/argparser.js index 7e68580b..7cb02dee 100644 --- a/lib/jsdoc/opts/argparser.js +++ b/lib/jsdoc/opts/argparser.js @@ -4,6 +4,7 @@ @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var _ = require('underscore'); diff --git a/lib/jsdoc/opts/args.js b/lib/jsdoc/opts/args.js index 994502fa..65e06715 100644 --- a/lib/jsdoc/opts/args.js +++ b/lib/jsdoc/opts/args.js @@ -4,6 +4,7 @@ @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var ArgParser = require('jsdoc/opts/argparser'), argParser = new ArgParser(), diff --git a/lib/jsdoc/package.js b/lib/jsdoc/package.js index 9b9cf99d..8c2a43e9 100644 --- a/lib/jsdoc/package.js +++ b/lib/jsdoc/package.js @@ -3,6 +3,7 @@ @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; /** @module jsdoc/package diff --git a/lib/jsdoc/path.js b/lib/jsdoc/path.js index 4f6b037f..16681126 100644 --- a/lib/jsdoc/path.js +++ b/lib/jsdoc/path.js @@ -3,6 +3,7 @@ * Extended version of the standard `path` module. * @module jsdoc/path */ +'use strict'; var fs = require('fs'); var path = require('path'); diff --git a/lib/jsdoc/plugins.js b/lib/jsdoc/plugins.js index ce757c78..8f9e6ead 100644 --- a/lib/jsdoc/plugins.js +++ b/lib/jsdoc/plugins.js @@ -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'); diff --git a/lib/jsdoc/readme.js b/lib/jsdoc/readme.js index 0e3ca21e..01562b87 100644 --- a/lib/jsdoc/readme.js +++ b/lib/jsdoc/readme.js @@ -6,6 +6,7 @@ * @author Michael Mathews * @author Ben Blank */ +'use strict'; var fs = require('jsdoc/fs'), markdown = require('jsdoc/util/markdown'); diff --git a/lib/jsdoc/schema.js b/lib/jsdoc/schema.js index 2fa32dde..48569183 100644 --- a/lib/jsdoc/schema.js +++ b/lib/jsdoc/schema.js @@ -4,6 +4,7 @@ @license Apache License 2.0 - See file 'LICENSE.md' in this project. @see */ +'use strict'; exports.jsdocSchema = { "properties": { diff --git a/lib/jsdoc/src/astbuilder.js b/lib/jsdoc/src/astbuilder.js index cc756ba9..fa221914 100644 --- a/lib/jsdoc/src/astbuilder.js +++ b/lib/jsdoc/src/astbuilder.js @@ -1,3 +1,5 @@ +'use strict'; + var Syntax = require('jsdoc/src/syntax').Syntax; // TODO: should set e.stopPropagation == true for consistency with Rhino, right? diff --git a/lib/jsdoc/src/filter.js b/lib/jsdoc/src/filter.js index c89eec10..f260a458 100644 --- a/lib/jsdoc/src/filter.js +++ b/lib/jsdoc/src/filter.js @@ -5,6 +5,7 @@ @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var path = require('jsdoc/path'); diff --git a/lib/jsdoc/src/handlers.js b/lib/jsdoc/src/handlers.js index 826e3130..028d93f1 100644 --- a/lib/jsdoc/src/handlers.js +++ b/lib/jsdoc/src/handlers.js @@ -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); } } } diff --git a/lib/jsdoc/src/parser.js b/lib/jsdoc/src/parser.js index b4837724..cc89e5f3 100644 --- a/lib/jsdoc/src/parser.js +++ b/lib/jsdoc/src/parser.js @@ -2,6 +2,7 @@ /** * @module jsdoc/src/parser */ +'use strict'; var Doclet = require('jsdoc/doclet'); var name = require('jsdoc/name'); diff --git a/lib/jsdoc/src/scanner.js b/lib/jsdoc/src/scanner.js index ec5539ed..91b7ecb9 100644 --- a/lib/jsdoc/src/scanner.js +++ b/lib/jsdoc/src/scanner.js @@ -6,7 +6,7 @@ @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ - +'use strict'; var fs = require('jsdoc/fs'); var path = require('jsdoc/path'); diff --git a/lib/jsdoc/src/syntax.js b/lib/jsdoc/src/syntax.js index c8fd0e8b..2207ae0b 100644 --- a/lib/jsdoc/src/syntax.js +++ b/lib/jsdoc/src/syntax.js @@ -1,3 +1,5 @@ +'use strict'; + // TODO: docs exports.Syntax = { ArrayExpression: 'ArrayExpression', diff --git a/lib/jsdoc/src/visitor.js b/lib/jsdoc/src/visitor.js index 1808a0ff..3174ffcf 100644 --- a/lib/jsdoc/src/visitor.js +++ b/lib/jsdoc/src/visitor.js @@ -1,6 +1,7 @@ /** * @module jsdoc/src/visitor */ +'use strict'; // TODO: consider exporting more stuff so users can override it diff --git a/lib/jsdoc/src/walker.js b/lib/jsdoc/src/walker.js index 019bbfca..b89ea10e 100644 --- a/lib/jsdoc/src/walker.js +++ b/lib/jsdoc/src/walker.js @@ -5,6 +5,7 @@ * @module jsdoc/src/walker * @license MIT */ +'use strict'; var Syntax = require('jsdoc/src/syntax').Syntax; diff --git a/lib/jsdoc/tag.js b/lib/jsdoc/tag.js index ca59f95d..7732e3af 100644 --- a/lib/jsdoc/tag.js +++ b/lib/jsdoc/tag.js @@ -12,6 +12,7 @@ @requires jsdoc/tag/validator @requires jsdoc/tag/type */ +'use strict'; var jsdoc = { tag: { diff --git a/lib/jsdoc/tag/dictionary.js b/lib/jsdoc/tag/dictionary.js index e87cc88c..75580b01 100644 --- a/lib/jsdoc/tag/dictionary.js +++ b/lib/jsdoc/tag/dictionary.js @@ -3,6 +3,7 @@ @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var hasOwnProp = Object.prototype.hasOwnProperty; diff --git a/lib/jsdoc/tag/dictionary/definitions.js b/lib/jsdoc/tag/dictionary/definitions.js index 752f8211..29f3f7f9 100644 --- a/lib/jsdoc/tag/dictionary/definitions.js +++ b/lib/jsdoc/tag/dictionary/definitions.js @@ -6,6 +6,7 @@ @author Michael Mathews @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; diff --git a/lib/jsdoc/tag/inline.js b/lib/jsdoc/tag/inline.js index c25ab4d1..04494a7e 100644 --- a/lib/jsdoc/tag/inline.js +++ b/lib/jsdoc/tag/inline.js @@ -4,6 +4,7 @@ * @author Jeff Williams * @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 || ''; diff --git a/lib/jsdoc/tag/type.js b/lib/jsdoc/tag/type.js index e2d384a2..35fdd509 100644 --- a/lib/jsdoc/tag/type.js +++ b/lib/jsdoc/tag/type.js @@ -5,6 +5,7 @@ * @author Jeff Williams * @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var jsdoc = { name: require('jsdoc/name'), diff --git a/lib/jsdoc/tag/validator.js b/lib/jsdoc/tag/validator.js index 5621cced..a58b2e9f 100644 --- a/lib/jsdoc/tag/validator.js +++ b/lib/jsdoc/tag/validator.js @@ -6,7 +6,7 @@ @author Michael Mathews @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; diff --git a/lib/jsdoc/template.js b/lib/jsdoc/template.js index 3fb2e762..43356617 100644 --- a/lib/jsdoc/template.js +++ b/lib/jsdoc/template.js @@ -4,6 +4,7 @@ * @author Matthew Christopher Kastor-Inare III * @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var _ = require('underscore'), fs = require('jsdoc/fs'), diff --git a/lib/jsdoc/tutorial.js b/lib/jsdoc/tutorial.js index 81ef5b5b..f55d63ca 100644 --- a/lib/jsdoc/tutorial.js +++ b/lib/jsdoc/tutorial.js @@ -3,6 +3,7 @@ @author RafaƂ Wrzeszcz @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ +'use strict'; var markdown = require('jsdoc/util/markdown'); diff --git a/lib/jsdoc/tutorial/resolver.js b/lib/jsdoc/tutorial/resolver.js index c07a3f7e..daf8b924 100644 --- a/lib/jsdoc/tutorial/resolver.js +++ b/lib/jsdoc/tutorial/resolver.js @@ -8,6 +8,7 @@ /** @module jsdoc/tutorial/resolver */ +'use strict'; var tutorial = require('jsdoc/tutorial'), fs = require('jsdoc/fs'), diff --git a/lib/jsdoc/util/doop.js b/lib/jsdoc/util/doop.js index 102a6133..3b2ca34d 100644 --- a/lib/jsdoc/util/doop.js +++ b/lib/jsdoc/util/doop.js @@ -2,6 +2,8 @@ Deep clone a simple object. @private */ +'use strict'; + function doop(o) { var clone; var props; diff --git a/lib/jsdoc/util/dumper.js b/lib/jsdoc/util/dumper.js index ac838912..69e27494 100644 --- a/lib/jsdoc/util/dumper.js +++ b/lib/jsdoc/util/dumper.js @@ -4,6 +4,7 @@ * @author Michael Mathews * @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); } } diff --git a/lib/jsdoc/util/error.js b/lib/jsdoc/util/error.js index 57d950b3..406c9166 100644 --- a/lib/jsdoc/util/error.js +++ b/lib/jsdoc/util/error.js @@ -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: diff --git a/lib/jsdoc/util/markdown.js b/lib/jsdoc/util/markdown.js index 3c5debd7..c19e7fcc 100644 --- a/lib/jsdoc/util/markdown.js +++ b/lib/jsdoc/util/markdown.js @@ -6,6 +6,7 @@ * @author Michael Mathews * @author Ben Blank */ +'use strict'; /** * Enumeration of Markdown parsers that are available. diff --git a/lib/jsdoc/util/runtime.js b/lib/jsdoc/util/runtime.js index 3879b7be..38a2a5d8 100644 --- a/lib/jsdoc/util/runtime.js +++ b/lib/jsdoc/util/runtime.js @@ -5,6 +5,7 @@ * @module jsdoc/util/runtime * @private */ +'use strict'; var os = require('os'); diff --git a/lib/jsdoc/util/templateHelper.js b/lib/jsdoc/util/templateHelper.js index 155d4cce..75891acb 100644 --- a/lib/jsdoc/util/templateHelper.js +++ b/lib/jsdoc/util/templateHelper.js @@ -2,6 +2,7 @@ /** * @module jsdoc/util/templateHelper */ +'use strict'; var dictionary = require('jsdoc/tag/dictionary'); var util = require('util'); diff --git a/node/fs.js b/node/fs.js index 1b47f6f4..c9b59321 100644 --- a/node/fs.js +++ b/node/fs.js @@ -1,3 +1,5 @@ +'use strict'; + var fs = require('fs'); var path = require('path'); var stream = require('stream'); diff --git a/node/path.js b/node/path.js index 0d460d98..979f12f9 100644 --- a/node/path.js +++ b/node/path.js @@ -1,3 +1,5 @@ +'use strict'; + exports.pathToUri = function(_path) { return _path; }; diff --git a/node/postinstall.js b/node/postinstall.js index 242bec0e..1bd8e214 100644 --- a/node/postinstall.js +++ b/node/postinstall.js @@ -1,5 +1,7 @@ #!/usr/bin/env node +'use strict'; + var fs = require('fs'); var path = require('path'); diff --git a/plugins/commentConvert.js b/plugins/commentConvert.js index 244c3313..cac6d874 100644 --- a/plugins/commentConvert.js +++ b/plugins/commentConvert.js @@ -3,7 +3,7 @@ @module plugins/commentConvert @author Michael Mathews */ - +'use strict'; exports.handlers = { /// diff --git a/plugins/commentsOnly.js b/plugins/commentsOnly.js index e5106e9f..a35e96f1 100644 --- a/plugins/commentsOnly.js +++ b/plugins/commentsOnly.js @@ -5,6 +5,7 @@ * @module plugins/commentsOnly * @author Jeff Williams */ +'use strict'; exports.handlers = { beforeParse: function(e) { diff --git a/plugins/escapeHtml.js b/plugins/escapeHtml.js index d77c2629..d5874052 100644 --- a/plugins/escapeHtml.js +++ b/plugins/escapeHtml.js @@ -3,7 +3,7 @@ @module plugins/escapeHtml @author Michael Mathews */ - +'use strict'; exports.handlers = { /** diff --git a/plugins/eventDumper.js b/plugins/eventDumper.js index 27857455..48cf4f64 100644 --- a/plugins/eventDumper.js +++ b/plugins/eventDumper.js @@ -4,6 +4,7 @@ * @module plugins/eventDumper * @author Jeff Williams */ +'use strict'; var _ = require('underscore'); var util = require('util'); diff --git a/plugins/markdown.js b/plugins/markdown.js index 1271bb5d..9d7db537 100644 --- a/plugins/markdown.js +++ b/plugins/markdown.js @@ -5,6 +5,8 @@ * @author Michael Mathews * @author Ben Blank */ +'use strict'; + var conf = env.conf.markdown; var defaultTags = [ "classdesc", "description", "params", "properties", "returns", "see"]; var hasOwnProp = Object.prototype.hasOwnProperty; diff --git a/plugins/overloadHelper.js b/plugins/overloadHelper.js index 35fe3213..d1257b73 100644 --- a/plugins/overloadHelper.js +++ b/plugins/overloadHelper.js @@ -36,6 +36,7 @@ * @author Jeff Williams * @license Apache License 2.0 */ +'use strict'; // lookup table of function doclets by longname var functionDoclets; diff --git a/plugins/partial.js b/plugins/partial.js index 61d20d26..2718adc4 100644 --- a/plugins/partial.js +++ b/plugins/partial.js @@ -4,6 +4,7 @@ @module plugins/partial @author Ludo Antonov */ +'use strict'; var fs = require('jsdoc/fs'); var path = require('path'); diff --git a/plugins/railsTemplate.js b/plugins/railsTemplate.js index 9ca63098..2328efcd 100644 --- a/plugins/railsTemplate.js +++ b/plugins/railsTemplate.js @@ -3,7 +3,7 @@ @module plugins/railsTemplate @author Jannon Frank */ - +'use strict'; exports.handlers = { /** diff --git a/plugins/shout.js b/plugins/shout.js index bb9c2c5d..34ed07c9 100644 --- a/plugins/shout.js +++ b/plugins/shout.js @@ -3,6 +3,7 @@ @module plugins/shout @author Michael Mathews */ +'use strict'; exports.handlers = { /** diff --git a/plugins/sourcetag.js b/plugins/sourcetag.js index efde8e0a..47de68e4 100644 --- a/plugins/sourcetag.js +++ b/plugins/sourcetag.js @@ -2,6 +2,7 @@ @module plugins/sourcetag @author Michael Mathews */ +'use strict'; exports.handlers = { /** diff --git a/plugins/verboseOutput.js b/plugins/verboseOutput.js index 454a4a05..af145429 100644 --- a/plugins/verboseOutput.js +++ b/plugins/verboseOutput.js @@ -4,6 +4,7 @@ * @author Rob Taylor - The basic idea * @author Michael Mathews - Wrote the first itteration with me :) */ +'use strict'; exports.handlers = { /** diff --git a/rhino/crypto.js b/rhino/crypto.js index 487e55cf..35e162b7 100644 --- a/rhino/crypto.js +++ b/rhino/crypto.js @@ -1 +1,3 @@ +'use strict'; + module.exports = require('crypto-browserify'); diff --git a/rhino/events.js b/rhino/events.js index 4546adab..9a431064 100644 --- a/rhino/events.js +++ b/rhino/events.js @@ -3,6 +3,7 @@ * @see https://github.com/substack/node-browserify * @license MIT */ +'use strict'; if (!process.EventEmitter) { process.EventEmitter = function () {}; diff --git a/rhino/fs.js b/rhino/fs.js index 80c716a0..f03068d8 100644 --- a/rhino/fs.js +++ b/rhino/fs.js @@ -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'); diff --git a/rhino/jsdoc.js b/rhino/jsdoc.js index f3de7b89..b8a7c115 100644 --- a/rhino/jsdoc.js +++ b/rhino/jsdoc.js @@ -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() ); diff --git a/rhino/jsdoc/src/astbuilder.js b/rhino/jsdoc/src/astbuilder.js index 952ee2b1..1d62560e 100644 --- a/rhino/jsdoc/src/astbuilder.js +++ b/rhino/jsdoc/src/astbuilder.js @@ -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(); diff --git a/rhino/jsdoc/src/parser.js b/rhino/jsdoc/src/parser.js index a0b5e2e7..f5fe39c9 100644 --- a/rhino/jsdoc/src/parser.js +++ b/rhino/jsdoc/src/parser.js @@ -1,4 +1,5 @@ // TODO: module docs +'use strict'; // TODO: docs exports.createParser = require('jsdoc/src/parser').createParser; diff --git a/rhino/jsdoc/src/visitor.js b/rhino/jsdoc/src/visitor.js index a12fadff..0295f2df 100644 --- a/rhino/jsdoc/src/visitor.js +++ b/rhino/jsdoc/src/visitor.js @@ -1,4 +1,5 @@ // TODO: module docs +'use strict'; // TODO: docs var Visitor = exports.Visitor = function(parser) { diff --git a/rhino/os.js b/rhino/os.js index ea9553c3..e3d2b787 100644 --- a/rhino/os.js +++ b/rhino/os.js @@ -4,6 +4,7 @@ * @author Jeff Williams * @see http://nodejs.org/api/os.html */ +'use strict'; exports.EOL = String( java.lang.System.getProperty('line.separator') ); diff --git a/rhino/path.js b/rhino/path.js index 7dc83c86..7458ec0c 100644 --- a/rhino/path.js +++ b/rhino/path.js @@ -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") ); diff --git a/rhino/querystring.js b/rhino/querystring.js index b38921a4..43ba05ca 100644 --- a/rhino/querystring.js +++ b/rhino/querystring.js @@ -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 diff --git a/rhino/rhino-shim.js b/rhino/rhino-shim.js index b584ee88..7e92d75c 100644 --- a/rhino/rhino-shim.js +++ b/rhino/rhino-shim.js @@ -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 = {}; diff --git a/templates/default/publish.js b/templates/default/publish.js index 11880854..926b1b22 100644 --- a/templates/default/publish.js +++ b/templates/default/publish.js @@ -1,4 +1,6 @@ /*global env: true */ +'use strict'; + var template = require('jsdoc/template'), fs = require('jsdoc/fs'), path = require('jsdoc/path'), diff --git a/templates/haruki/publish.js b/templates/haruki/publish.js index 45c79876..b738aa67 100644 --- a/templates/haruki/publish.js +++ b/templates/haruki/publish.js @@ -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 {