Permalink
Browse files

Run jslint during build

  • Loading branch information...
Ajnasz committed Aug 16, 2012
1 parent 9aba9e1 commit 2da457ae25678db5b28735ec73c64e2c03a16ee3
Showing with 19 additions and 6 deletions.
  1. +0 −1 .travis.yml
  2. +11 −2 Jakefile.js
  3. +6 −2 index.js
  4. +2 −1 package.json
View
@@ -2,4 +2,3 @@ language: node_js
node_js:
- 0.8
- 0.6
- - 0.4
View
@@ -1,8 +1,17 @@
var spawn = require('child_process').spawn;
-desc('default', 'Run tests');
-task('default', function (t) {
+task('default', ['test', 'jslint']);
+
+desc('test', 'Run tests');
+task('test', function (t) {
spawn('node', ['tests/test.js'], {
stdio: 'inherit'
});
});
+
+desc('jslint', 'Check syntax');
+task('jslint', function (t) {
+ spawn('jslint', ['index.js'], {
+ stdio: 'inherit'
+ });
+});
View
@@ -1,8 +1,10 @@
/*jslint node: true*/
function getCookie(req, cookieName) {
+ "use strict";
var cookies = {},
cn,
output;
+
if (req.headers.cookie) {
req.headers.cookie.split(';').forEach(function (cookie) {
var parts = cookie.split('=');
@@ -25,10 +27,12 @@ function getCookie(req, cookieName) {
});
output = cookies[cookieName];
}
+
return output;
}
function setCookie(res, cookie, val, expiration, domain, secure, httpOnly, path) {
+ "use strict";
var cookieVal = cookie + '=' + val,
expdate,
cookies;
@@ -52,7 +56,6 @@ function setCookie(res, cookie, val, expiration, domain, secure, httpOnly, path)
cookieVal += '; Path=' + path;
}
-
if (secure) {
cookieVal += '; Secure';
}
@@ -74,9 +77,10 @@ function setCookie(res, cookie, val, expiration, domain, secure, httpOnly, path)
res.setHeader('Set-Cookie', cookieVal);
}
-const day = 60 * 60 * 24 * 1000;
+var day = 60 * 60 * 24 * 1000;
function delCookie(res, cookie, domain, secure, httpOnly) {
+ "use strict";
// minus a day
setCookie(res, cookie, "", Date.now() - day, domain, secure, httpOnly);
}
View
@@ -12,7 +12,8 @@
},
"dependencies": {},
"devDependencies": {
- "jake": ">=0.3.11"
+ "jake": ">=0.3.11",
+ "jslint": ">=0.1.9"
},
"optionalDependencies": {}
}

0 comments on commit 2da457a

Please sign in to comment.