Skip to content

Commit

Permalink
Fix JSHint errors, and make JSHint run on Travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Jun 5, 2013
1 parent 19df221 commit 81416b1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

"curly": true,
"eqeqeq": true,
"es3": true,
"newcap": true,
"noarg": true,
"nonew": true,
"quotmark": "double",
"strict": true,
"trailing": true,
"undef": true,
"unused": true,
Expand All @@ -18,6 +20,7 @@
"define": false,
"ReturnValue": false,
"ses": false,
"setImmediate": false
"setImmediate": false,
"Q": true
}
}
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_js:
- "0.6"
- "0.8"
- "0.10"
script:
npm run lint && npm test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"dependencies": {},
"devDependencies": {
"jshint": ">=1.1.0",
"jshint": "~2.1.3",
"cover": "*",
"jasmine-node": "1.2.2",
"opener": "*",
Expand Down
12 changes: 8 additions & 4 deletions q.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

(function (definition) {
// Turn off strict mode for this function so we can assign to global.Q
/*jshint strict: false, -W117*/
/* jshint strict: false */

// This file will function properly as a <script> tag, or a module
// using CommonJS and NodeJS or RequireJS module formats. In
Expand Down Expand Up @@ -294,6 +294,7 @@ if (typeof ReturnValue !== "undefined") {
// this block.
var hasES6Generators;
try {
/* jshint evil: true, nonew: false */
new Function("(function* (){ yield 1; })");
hasES6Generators = true;
} catch (e) {
Expand All @@ -302,8 +303,6 @@ try {

// long stack traces

Q.longStackJumpLimit = 1;

var STACK_JUMP_SEPARATOR = "From previous event:";

function makeStackTraceLong(error, promise) {
Expand Down Expand Up @@ -427,6 +426,11 @@ function Q(value) {
*/
Q.nextTick = nextTick;

/**
* Controls whether or not long stack traces will be on
*/
Q.longStackJumpLimit = 1;

/**
* Constructs a {promise, resolve} object.
*
Expand Down Expand Up @@ -825,7 +829,7 @@ function trackRejection(promise, reason) {
displayUnhandledReasons();
}

function untrackRejection(promise, reason) {
function untrackRejection(promise) {
if (!trackUnhandledRejections) {
return;
}
Expand Down

0 comments on commit 81416b1

Please sign in to comment.