Obeisance to JSHint for core modules

There are still some warnings about making functions in a loop, but
I’ll fix those as a separate pull request because the fixes are more
than typographic errors.
This commit is contained in:
Jermolene
2014-08-30 20:44:26 +01:00
parent 2a3e54b064
commit 3a67fdb768
48 changed files with 173 additions and 169 deletions
+6 -6
View File
@@ -78,7 +78,7 @@ SimpleServer.prototype.findMatchingRoute = function(request,state) {
};
SimpleServer.prototype.checkCredentials = function(request,incomingUsername,incomingPassword) {
var header = request.headers["authorization"] || "",
var header = request.headers.authorization || "",
token = header.split(/\s+/).pop() || "",
auth = $tw.utils.base64Decode(token),
parts = auth.split(/:/),
@@ -89,7 +89,7 @@ SimpleServer.prototype.checkCredentials = function(request,incomingUsername,inco
} else {
return "DENIED";
}
}
};
SimpleServer.prototype.listen = function(port,host) {
var self = this;
@@ -167,8 +167,8 @@ var Command = function(params,commander,callback) {
delete fields.fields;
}
// Remove any revision field
if(fields["revision"]) {
delete fields["revision"];
if(fields.revision) {
delete fields.revision;
}
state.wiki.addTiddler(new $tw.Tiddler(state.wiki.getCreationFields(),fields,{title: title}));
var changeCount = state.wiki.getChangeCount(title).toString();
@@ -237,7 +237,7 @@ var Command = function(params,commander,callback) {
tiddlerFields[name] = tiddler.getFieldString(name);
}
});
tiddlerFields["revision"] = state.wiki.getChangeCount(title);
tiddlerFields.revision = state.wiki.getChangeCount(title);
tiddlerFields.type = tiddlerFields.type || "text/vnd.tiddlywiki";
tiddlers.push(tiddlerFields);
});
@@ -265,7 +265,7 @@ var Command = function(params,commander,callback) {
tiddlerFields.fields[name] = value;
}
});
tiddlerFields["revision"] = state.wiki.getChangeCount(title);
tiddlerFields.revision = state.wiki.getChangeCount(title);
tiddlerFields.type = tiddlerFields.type || "text/vnd.tiddlywiki";
response.writeHead(200, {"Content-Type": "application/json"});
response.end(JSON.stringify(tiddlerFields),"utf8");