Skip to content

Commit f55feb1

Browse files
committed
'use strict'ify
1 parent 3716df0 commit f55feb1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+98
-24
lines changed

cli.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* @private
1313
*/
1414
module.exports = (function() {
15+
'use strict';
1516

1617
var props = {
1718
docs: [],

jsdoc.js

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ global.dump = function() {
124124
};
125125

126126
(function() {
127+
'use strict';
128+
127129
function cb(errorCode) {
128130
process.exit(errorCode || 0);
129131
}

lib/jsdoc/augment.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var hasOwnProp = Object.prototype.hasOwnProperty;
24

35
function mapDependencies(index) {

lib/jsdoc/borrow.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@author Michael Mathews <[email protected]>
55
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
66
*/
7+
'use strict';
78

89
var doop = require("jsdoc/util/doop").doop;
910

lib/jsdoc/config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/**
88
@module jsdoc/config
99
*/
10+
'use strict';
1011

1112
function mergeRecurse(target, source) {
1213
Object.keys(source).forEach(function(p) {
@@ -23,7 +24,7 @@ function mergeRecurse(target, source) {
2324
}
2425

2526
// required config values, override these defaults in your config.json if necessary
26-
const defaults = {
27+
var defaults = {
2728
"tags": {
2829
"allowUnknownTags": true
2930
},

lib/jsdoc/doclet.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/**
88
* @module jsdoc/doclet
99
*/
10+
'use strict';
1011

1112
var _ = require('underscore');
1213
var jsdoc = {
@@ -33,21 +34,21 @@ exports.GLOBAL_LONGNAME = '<global>';
3334
exports.UNDOCUMENTED_TAG = '@undocumented';
3435

3536

36-
function applyTag(tag) {
37+
function applyTag(doclet, tag) {
3738
if (tag.title === 'name') {
38-
this.name = tag.value;
39+
doclet.name = tag.value;
3940
}
4041

4142
if (tag.title === 'kind') {
42-
this.kind = tag.value;
43+
doclet.kind = tag.value;
4344
}
4445

4546
if (tag.title === 'description') {
46-
this.description = tag.value;
47+
doclet.description = tag.value;
4748
}
4849

4950
if (tag.title === 'scope') {
50-
this.scope = tag.value;
51+
doclet.scope = tag.value;
5152
}
5253
}
5354

@@ -212,7 +213,7 @@ Doclet.prototype.addTag = function(title, text) {
212213
this.tags.push(newTag);
213214
}
214215

215-
applyTag.call(this, newTag);
216+
applyTag(this, newTag);
216217
};
217218

218219
function removeGlobal(longname) {

lib/jsdoc/fs.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Extended version of the standard `fs` module.
33
* @module jsdoc/fs
44
*/
5+
'use strict';
6+
57
var fs = require('fs');
68
var path = require('path');
79
var runtime = require('jsdoc/util/runtime');

lib/jsdoc/name.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@author Michael Mathews <[email protected]>
66
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
77
*/
8+
'use strict';
89

910
var _ = require('underscore');
1011
var jsdoc = {

lib/jsdoc/opts/argparser.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@author Michael Mathews <[email protected]>
55
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
66
*/
7+
'use strict';
78

89
var _ = require('underscore');
910

lib/jsdoc/opts/args.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@author Michael Mathews <[email protected]>
55
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
66
*/
7+
'use strict';
78

89
var ArgParser = require('jsdoc/opts/argparser'),
910
argParser = new ArgParser(),

lib/jsdoc/package.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@author Michael Mathews <[email protected]>
44
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
55
*/
6+
'use strict';
67

78
/**
89
@module jsdoc/package

lib/jsdoc/path.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Extended version of the standard `path` module.
44
* @module jsdoc/path
55
*/
6+
'use strict';
67

78
var fs = require('fs');
89
var path = require('path');

lib/jsdoc/plugins.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Utility functions to support the JSDoc plugin framework.
44
* @module jsdoc/plugins
55
*/
6+
'use strict';
67

78
var error = require('jsdoc/util/error');
89
var path = require('jsdoc/path');

lib/jsdoc/readme.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* @author Michael Mathews <[email protected]>
77
* @author Ben Blank <[email protected]>
88
*/
9+
'use strict';
910

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

lib/jsdoc/schema.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
55
@see <http://tools.ietf.org/html/draft-zyp-json-schema-02>
66
*/
7+
'use strict';
78

89
exports.jsdocSchema = {
910
"properties": {

lib/jsdoc/src/astbuilder.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
var Syntax = require('jsdoc/src/syntax').Syntax;
24

35
// TODO: should set e.stopPropagation == true for consistency with Rhino, right?

lib/jsdoc/src/filter.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@author Michael Mathews <[email protected]>
66
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
77
*/
8+
'use strict';
89

910
var path = require('jsdoc/path');
1011

lib/jsdoc/src/handlers.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @module jsdoc/src/handlers
33
*/
4-
4+
'use strict';
55

66
var currentModule = null;
77

@@ -46,7 +46,7 @@ exports.attachTo = function(parser) {
4646
return false; // only interested in virtual comments (with a @name) here
4747
}
4848

49-
addDoclet.call(this, newDoclet);
49+
addDoclet.call(parser, newDoclet);
5050

5151
e.doclet = newDoclet;
5252
});
@@ -56,7 +56,7 @@ exports.attachTo = function(parser) {
5656
var subDoclets = e.comment.split(/@also\b/g);
5757

5858
for (var i = 0, l = subDoclets.length; i < l; i++) {
59-
newSymbolDoclet.call(this, subDoclets[i], e);
59+
newSymbolDoclet.call(parser, subDoclets[i], e);
6060
}
6161
});
6262

@@ -74,7 +74,7 @@ exports.attachTo = function(parser) {
7474

7575
if (newDoclet.alias) {
7676
if (newDoclet.alias === '{@thisClass}') {
77-
memberofName = this.resolveThis(e.astnode);
77+
memberofName = parser.resolveThis(e.astnode);
7878

7979
// "class" refers to the owner of the prototype, not the prototype itself
8080
if ( /^(.+?)(\.prototype|#)$/.test(memberofName) ) {
@@ -107,7 +107,7 @@ exports.attachTo = function(parser) {
107107
else {
108108
// like /** @module foo */ exports = {bar: 1};
109109
// or /** blah */ this.foo = 1;
110-
memberofName = this.resolveThis(e.astnode);
110+
memberofName = parser.resolveThis(e.astnode);
111111
scope = nameStartsWith === 'exports'? 'static' : 'instance';
112112

113113
// like /** @module foo */ this.bar = 1;
@@ -125,7 +125,7 @@ exports.attachTo = function(parser) {
125125
}
126126
}
127127
else {
128-
memberofName = this.astnodeToMemberof(e.astnode);
128+
memberofName = parser.astnodeToMemberof(e.astnode);
129129
if( Array.isArray(memberofName) ) {
130130
basename = memberofName[1];
131131
memberofName = memberofName[0];
@@ -166,7 +166,7 @@ exports.attachTo = function(parser) {
166166
newDoclet.scope = 'global';
167167
}
168168

169-
addDoclet.call(this, newDoclet);
169+
addDoclet.call(parser, newDoclet);
170170
e.doclet = newDoclet;
171171
}
172172

@@ -179,10 +179,10 @@ exports.attachTo = function(parser) {
179179
if (newDoclet) {
180180
setCurrentModule(newDoclet);
181181
e = { doclet: newDoclet };
182-
this.emit('newDoclet', e);
182+
parser.emit('newDoclet', e);
183183

184184
if ( !e.defaultPrevented && !filter(newDoclet) ) {
185-
this.addResult(newDoclet);
185+
parser.addResult(newDoclet);
186186
}
187187
}
188188
}

lib/jsdoc/src/parser.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/**
33
* @module jsdoc/src/parser
44
*/
5+
'use strict';
56

67
var Doclet = require('jsdoc/doclet');
78
var name = require('jsdoc/name');

lib/jsdoc/src/scanner.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@author Michael Mathews <[email protected]>
77
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
88
*/
9-
9+
'use strict';
1010

1111
var fs = require('jsdoc/fs');
1212
var path = require('jsdoc/path');

lib/jsdoc/src/syntax.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
// TODO: docs
24
exports.Syntax = {
35
ArrayExpression: 'ArrayExpression',

lib/jsdoc/src/visitor.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/**
22
* @module jsdoc/src/visitor
33
*/
4+
'use strict';
45

56
// TODO: consider exporting more stuff so users can override it
67

lib/jsdoc/src/walker.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* @module jsdoc/src/walker
66
* @license MIT
77
*/
8+
'use strict';
89

910
var Syntax = require('jsdoc/src/syntax').Syntax;
1011

lib/jsdoc/tag.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
@requires jsdoc/tag/validator
1313
@requires jsdoc/tag/type
1414
*/
15+
'use strict';
1516

1617
var jsdoc = {
1718
tag: {

lib/jsdoc/tag/dictionary.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@author Michael Mathews <[email protected]>
44
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
55
*/
6+
'use strict';
67

78
var hasOwnProp = Object.prototype.hasOwnProperty;
89

lib/jsdoc/tag/dictionary/definitions.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
@author Michael Mathews <[email protected]>
77
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
88
*/
9+
'use strict';
910

1011
var path = require('jsdoc/path');
1112
var Syntax = require('jsdoc/src/syntax').Syntax;

lib/jsdoc/tag/inline.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @author Jeff Williams <[email protected]>
55
* @license Apache License 2.0 - See file 'LICENSE.md' in this project.
66
*/
7+
'use strict';
78

89
/**
910
* Information about an inline tag that was found within a string.
@@ -94,7 +95,7 @@ exports.replaceInlineTags = function(string, replacers) {
9495
};
9596
tagInfo.push(matchedTag);
9697

97-
return replacer.call(this, string, matchedTag);
98+
return replacer(string, matchedTag);
9899
}
99100

100101
string = string || '';

lib/jsdoc/tag/type.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* @author Jeff Williams <[email protected]>
66
* @license Apache License 2.0 - See file 'LICENSE.md' in this project.
77
*/
8+
'use strict';
89

910
var jsdoc = {
1011
name: require('jsdoc/name'),

lib/jsdoc/tag/validator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@author Michael Mathews <[email protected]>
77
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
88
*/
9-
9+
'use strict';
1010

1111
var dictionary = require('jsdoc/tag/dictionary');
1212
var format = require('util').format;

lib/jsdoc/template.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @author <a href="mailto:[email protected]">Matthew Christopher Kastor-Inare III</a>
55
* @license Apache License 2.0 - See file 'LICENSE.md' in this project.
66
*/
7+
'use strict';
78

89
var _ = require('underscore'),
910
fs = require('jsdoc/fs'),

lib/jsdoc/tutorial.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@author Rafał Wrzeszcz <[email protected]>
44
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
55
*/
6+
'use strict';
67

78
var markdown = require('jsdoc/util/markdown');
89

lib/jsdoc/tutorial/resolver.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/**
99
@module jsdoc/tutorial/resolver
1010
*/
11+
'use strict';
1112

1213
var tutorial = require('jsdoc/tutorial'),
1314
fs = require('jsdoc/fs'),

lib/jsdoc/util/doop.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Deep clone a simple object.
33
@private
44
*/
5+
'use strict';
6+
57
function doop(o) {
68
var clone;
79
var props;

0 commit comments

Comments
 (0)