Browse files

fix lint complaints

  • Loading branch information...
1 parent e79e027 commit bb087703cbb6fec82cdbb70d18cbad3f58380381 Bret Thaeler committed Sep 13, 2012
View
9 lib/app/autoload/debug-api.common.js
@@ -29,10 +29,9 @@ YUI.add('mojito-debug-api', function(Y, NAME) {
this.flag = function (flag) {
if (store.modules[flag]) {
@caridy
caridy added a note Oct 11, 2012

return !!store.modules[flag]; should be just enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
return true;
- } else {
- return false;
}
- }
+ return false;
+ };
this.on = function (flag, f) {
@@ -126,7 +125,7 @@ YUI.add('mojito-debug-api', function(Y, NAME) {
store.modules[flag].data[node].close.push({
type: type,
time: this.timestamp()
- });
+ });
};
this.profEvent = function (profType, type) {
@@ -143,7 +142,7 @@ YUI.add('mojito-debug-api', function(Y, NAME) {
store.modules[flag].events.push({
type: type,
time: this.timestamp()
- });
+ });
};
}
}
View
2 lib/app/autoload/dispatch.common.js
@@ -82,7 +82,7 @@ YUI.add('mojito-dispatcher', function(Y, NAME) {
if (cc) {
if (adapter.debug) {
- adapter.debug.profOpen("dispatch", instance.instanceId, (instance.id || '@' + instance.type) + ':' + (command.action ? command.action : (instance.action || 'index')) + ":cached");
+ adapter.debug.profOpen("dispatch", instance.instanceId, (instance.id || '@' + instance.type) + ':' + (command.action || (instance.action || 'index')) + ":cached");
}
logger.log('using cached controller context: ' +
instance.instanceId, 'info', NAME);
View
2 lib/app/autoload/logger.common.js
@@ -156,7 +156,7 @@ YUI.add('mojito-logger', function(Y, NAME) {
if (this.debug) {
this.debug.logOn("AC_Logger", function () {
- return "" + now + ": " + source + ": " + level + ": " + msg;
+ return now + ": " + source + ": " + level + ": " + msg;
});
}
View
8 lib/app/autoload/perf.server.js
@@ -12,8 +12,8 @@
(function() {
//a single shared message buffer
- var buffer = [];
- var debug = null;
+ var buffer = [],
+ debug = null;
YUI.add('mojito-perf', function(Y, NAME) {
@@ -66,7 +66,7 @@
s = format(group, label, message, null, timestamp());
buffer.push(s);
if (debug) {
- debug.profOpen("PerfMark", "" + group + ":" + label, message);
+ debug.profOpen("PerfMark", group + ":" + label, message);
}
} else {
Y.log('Invalid request object', 'warn', NAME);
@@ -93,7 +93,7 @@
var s = format(group, label, message, id, timestamp());
buffer.push(s);
if (debug) {
- debug.profOpen("PerfMark", "" + group + ":" + label, message);
+ debug.profOpen("PerfMark", group + ":" + label, message);
}
};
View
12 lib/app/middleware/mojito-debug.js
@@ -62,7 +62,7 @@ Debug.prototype = {
// This prevents the debug mojit from being called directly by the user.
req.url = null;
console.warn("Request attempting to access debugger route directly");
- } else if (req.url.match(new RegExp("^.*\?(.*&)?" + queryParam + "=.+$"))) {
+ } else if (req.url.match(new RegExp("^.*?(.*&)?" + queryParam + "=.+$"))) {
// call application provided function to verify if this request shoudl be allowed or not
if (debugAllowHandler && !debugAllowHandler(req)) {
@@ -83,10 +83,10 @@ Debug.prototype = {
action: call[1],
context: req.context,
params: {
- route: [],
- url: liburl.parse(req.url, true).query || {},
- body: req.body || {},
- file: {}
+ route: [],
+ url: liburl.parse(req.url, true).query || {},
+ body: req.body || {},
+ file: {}
}
};
if (call[0][0] === '@') {
@@ -98,7 +98,7 @@ Debug.prototype = {
next();
};
}
-}
+};
module.exports = function(config) {
var debug = new Debug(config.Y, config.store);

0 comments on commit bb08770

Please sign in to comment.