Skip to content

Commit 3654945

Browse files
committed
Adapt buildtsdoc.js to correct jshint errors
1 parent df6b946 commit 3654945

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

tasks/buildtsdoc.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var TypeScriptDocGenerator = (function () {
1919
this.lineMap = this.tree.lineMap();
2020
}
2121
TypeScriptDocGenerator.prototype.completePrefix = function (oldPrefix, appendedPrefix) {
22-
if (oldPrefix == "") {
22+
if (oldPrefix === "") {
2323
return appendedPrefix;
2424
}
2525
else {
@@ -55,8 +55,8 @@ var TypeScriptDocGenerator = (function () {
5555
var nbSpaces = lc.character();
5656
var startLinePosition = this.lineMap.getLineStartPosition(lc.line());
5757
var comment = "\n" + this.repeatSpaces(nbSpaces) + "/**\n";
58-
for (var i = 0; i < commentLines.length; i++) {
59-
comment += this.repeatSpaces(nbSpaces) + "* " + commentLines[i] + "\n";
58+
for (var j = 0; j < commentLines.length; j++) {
59+
comment += this.repeatSpaces(nbSpaces) + "* " + commentLines[j] + "\n";
6060
}
6161
comment += this.repeatSpaces(nbSpaces) + "*/\n";
6262
this.tsDefFileContent = this.tsDefFileContent.substr(0, startLinePosition + this.nbCharsAdded) + comment + this.tsDefFileContent.substr(startLinePosition + this.nbCharsAdded);
@@ -65,7 +65,7 @@ var TypeScriptDocGenerator = (function () {
6565
}
6666
};
6767
TypeScriptDocGenerator.prototype.findClass = function (className) {
68-
if (className.indexOf("p2.") == 0) {
68+
if (className.indexOf("p2.") === 0) {
6969
className = className.replace("p2.", "Phaser.Physics.P2.");
7070
}
7171
var elements = this.docs.classes.filter(function (element) {
@@ -79,9 +79,9 @@ var TypeScriptDocGenerator = (function () {
7979
for (var i = 0; i < c.members.length; i++) {
8080
if (c.members[i].name == memberName) {
8181
var m = c.members[i];
82-
var comments = new Array();
82+
var comments = [];
8383
comments = comments.concat(m.description.split("\n"));
84-
if ((m.default != null) && (m.default != "")) {
84+
if ((m.default != null) && (m.default !== "")) {
8585
comments.push("Default: " + m.default);
8686
}
8787
return comments;
@@ -95,7 +95,7 @@ var TypeScriptDocGenerator = (function () {
9595
TypeScriptDocGenerator.prototype.generateClassComments = function (className) {
9696
var c = this.findClass(className);
9797
if (c != null) {
98-
var comments = new Array();
98+
var comments = [];
9999
comments = comments.concat(c.description.split("\n"));
100100
return comments;
101101
}
@@ -107,7 +107,7 @@ var TypeScriptDocGenerator = (function () {
107107
var c = this.findClass(className);
108108
if (c != null) {
109109
var con = c.constructor;
110-
var comments = new Array();
110+
var comments = [];
111111
comments = comments.concat(con.description.split("\n"));
112112
if (con.parameters.length > 0) {
113113
comments.push("");
@@ -118,7 +118,7 @@ var TypeScriptDocGenerator = (function () {
118118
p.name = "args";
119119
}
120120
var def = "";
121-
if ((p.default != null) && (p.default != "")) {
121+
if ((p.default != null) && (p.default !== "")) {
122122
def = " - Default: " + p.default;
123123
}
124124
comments.push("@param " + p.name + " - " + p.description + def);
@@ -133,9 +133,9 @@ var TypeScriptDocGenerator = (function () {
133133
var c = this.findClass(className);
134134
if (c != null) {
135135
for (var i = 0; i < c.functions.length; i++) {
136-
if (c.functions[i].name == functionName) {
136+
if (c.functions[i].name === functionName) {
137137
var f = c.functions[i];
138-
var comments = new Array();
138+
var comments = [];
139139
comments = comments.concat(f.description.split("\n"));
140140
if (f.parameters.length > 0) {
141141
comments.push("");
@@ -146,7 +146,7 @@ var TypeScriptDocGenerator = (function () {
146146
p.name = "args";
147147
}
148148
var def = "";
149-
if ((p.default != null) && (p.default != "")) {
149+
if ((p.default != null) && (p.default !== "")) {
150150
def = " - Default: " + p.default;
151151
}
152152
comments.push("@param " + p.name + " - " + p.description + def);
@@ -180,7 +180,7 @@ var TypeScriptDocGenerator = (function () {
180180
this.insertComment(this.generateFunctionComments(fullName, elem.propertyName.fullText().trim()), classPos + this.leadingWidth(elem));
181181
break;
182182
}
183-
if (elem.kind() != ts.SyntaxKind.List) {
183+
if (elem.kind() !== ts.SyntaxKind.List) {
184184
classPos += elem.fullWidth();
185185
}
186186
}
@@ -208,7 +208,7 @@ var TypeScriptDocGenerator = (function () {
208208
}
209209
break;
210210
}
211-
if ((elem.kind() != ts.SyntaxKind.List) && (elem.kind() != ts.SyntaxKind.ModuleDeclaration)) {
211+
if ((elem.kind() !== ts.SyntaxKind.List) && (elem.kind() !== ts.SyntaxKind.ModuleDeclaration)) {
212212
this.pos += elem.fullWidth();
213213
}
214214
}

0 commit comments

Comments
 (0)