Skip to content

Commit

Permalink
Add/fix comments. Add jshintrc and editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
briancavalier committed Nov 8, 2012
1 parent 3c16420 commit 1bf8157
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
@@ -0,0 +1,6 @@
root = true

[*]
indent_style = tab
indent_size = 4
end_of_line = LF
29 changes: 29 additions & 0 deletions .jshintrc
@@ -0,0 +1,29 @@
{
"browser": true,
"node": true,
"es5": true,

"predef": [
"define",
"setImmediate"
],

"boss": true,
"curly": true,
"eqnull": true,
"expr": true,
"globalstrict": false,
"laxbreak": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"quotmark": "single",
"strict": false,
"trailing": true,
"undef": true,
"unused": true,

"maxdepth": 3,
"maxcomplexity": 4
}
6 changes: 3 additions & 3 deletions avow.js
@@ -1,5 +1,4 @@
/* Copyright (c) 2012 Brian Cavalier */
/*global define:true, setImmediate:true*/
(function(define) {
define(function() {

Expand Down Expand Up @@ -104,6 +103,7 @@ define(function() {

// When the promise is fulfilled or rejected, call all pending handlers
function applyAllPending(apply, value) {
// Already fulfilled or rejected, ignore silently
if(!pending) {
return;
}
Expand All @@ -128,12 +128,12 @@ define(function() {
}
}

// Call fulfilled handler and fulfill the next promise in the chain
// Call fulfilled handler and forward to the next promise in the chain
function applyFulfill(val, onFulfilled, _, fulfillNext, rejectNext) {
return apply(val, onFulfilled, fulfillNext, fulfillNext, rejectNext);
}

// Call rejected handler and fulfill the next promise in the chain
// Call rejected handler and forward to the next promise in the chain
function applyReject(val, _, onRejected, fulfillNext, rejectNext) {
return apply(val, onRejected, rejectNext, fulfillNext, rejectNext);
}
Expand Down

0 comments on commit 1bf8157

Please sign in to comment.