Permalink
Browse files

Fixing some jslint warnings.

git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1037206 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 7a1c709 commit 6359774347b134237b0bdfa0fd0a409ba85eac8d @fdmanana fdmanana committed Nov 20, 2010
Showing with 19 additions and 15 deletions.
  1. +3 −3 share/server/loop.js
  2. +4 −4 share/server/mimeparse.js
  3. +4 −2 share/server/render.js
  4. +1 −1 share/server/state.js
  5. +6 −4 share/server/util.js
  6. +1 −1 share/server/views.js
View
@@ -72,14 +72,14 @@ var DDoc = (function() {
var point = ddoc;
for (var i=0; i < funPath.length; i++) {
if (i+1 == funPath.length) {
- fun = point[funPath[i]]
+ var fun = point[funPath[i]];
if (typeof fun != "function") {
fun = Couch.compileFunction(fun, ddoc);
// cache the compiled fun on the ddoc
- point[funPath[i]] = fun
+ point[funPath[i]] = fun;
};
} else {
- point = point[funPath[i]]
+ point = point[funPath[i]];
}
};
@@ -19,13 +19,13 @@
var Mimeparse = (function() {
// private helpers
function strip(string) {
- return string.replace(/^\s+/, '').replace(/\s+$/, '')
+ return string.replace(/^\s+/, '').replace(/\s+$/, '');
};
function parseRanges(ranges) {
var parsedRanges = [], rangeParts = ranges.split(",");
for (var i=0; i < rangeParts.length; i++) {
- parsedRanges.push(publicMethods.parseMediaRange(rangeParts[i]))
+ parsedRanges.push(publicMethods.parseMediaRange(rangeParts[i]));
};
return parsedRanges;
};
@@ -148,11 +148,11 @@ var Mimeparse = (function() {
var parsedHeader = parseRanges(header);
var weighted = [];
for (var i=0; i < supported.length; i++) {
- weighted.push([publicMethods.fitnessAndQualityParsed(supported[i], parsedHeader), i, supported[i]])
+ weighted.push([publicMethods.fitnessAndQualityParsed(supported[i], parsedHeader), i, supported[i]]);
};
weighted.sort();
return weighted[weighted.length-1][0][1] ? weighted[weighted.length-1][2] : '';
}
- }
+ };
return publicMethods;
})();
View
@@ -105,7 +105,9 @@ var Mime = (function() {
if (bestFun) {
return bestFun();
} else {
- var supportedTypes = mimeFuns.map(function(mf) {return mimesByKey[mf[0]].join(', ') || mf[0]});
+ var supportedTypes = mimeFuns.map(function(mf) {
+ return mimesByKey[mf[0]].join(', ') || mf[0];
+ });
throw(["error","not_acceptable",
"Content-Type "+(accept||bestKey)+" not supported, try one of: "+supportedTypes.join(', ')]);
}
@@ -117,7 +119,7 @@ var Mime = (function() {
provides : provides,
resetProvides : resetProvides,
runProvides : runProvides
- }
+ };
})();
View
@@ -29,4 +29,4 @@ var State = {
State.lib = lib;
print("true");
}
-}
+};
View
@@ -21,7 +21,7 @@ var resolveModule = function(names, mod, root) {
parent : mod.parent,
id : mod.id,
exports : {}
- }
+ };
}
// we need to traverse the path
var n = names.shift();
@@ -72,12 +72,14 @@ var Couch = {
var s = "function (module, exports, require) { " + newModule.current + " }";
try {
var func = sandbox ? evalcx(s, sandbox) : eval(s);
- func.apply(sandbox, [newModule, newModule.exports, function(name) {return require(name, newModule)}]);
+ func.apply(sandbox, [newModule, newModule.exports, function(name) {
+ return require(name, newModule);
+ }]);
} catch(e) {
throw ["error","compilation_error","Module require('"+name+"') raised error "+e.toSource()];
}
return newModule.exports;
- }
+ };
sandbox.require = require;
}
var functionObject = evalcx(source, sandbox);
@@ -103,7 +105,7 @@ var Couch = {
}
}
}
-}
+};
// prints the object as JSON, and rescues and logs any toJSON() related errors
function respond(obj) {
View
@@ -133,5 +133,5 @@ var Views = (function() {
}
print("[" + buf.join(", ") + "]");
}
- }
+ };
})();

0 comments on commit 6359774

Please sign in to comment.