Skip to content

Commit 42ee461

Browse files
committed
Correct embarrasing typos
1 parent 0f02505 commit 42ee461

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ return deferred.promise;
7575
[promise](https://github.com/promises-aplus/promises-spec) which features nothing more than a
7676
`then` method.
7777

78-
`defer.resolve(result)` will resolve the promise with given `result`. Thus, it will fulfil the
78+
`defer.resolve(result)` will resolve the promise with given `result`. Thus, it will fulfill the
7979
promise if `result` is a _value_, or cause it to assume `result`'s (future) state if it's a
8080
_promise_ itself. `defer.reject(reason)` will reject the promise with given `reason`.
8181

test/aplus-tests-adapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/*jshint node:true */
22
"use strict";
33
var tillthen = require("../tillthen.js");
4-
exports.pending = function () { return tillthen.defer(); };
4+
exports.pending = function () { return tillthen.defer(); };

tillthen.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@
144144
};
145145
},
146146

147-
// Create a deferred object: A pending promise with `resolve`, `fulfil` and `reject` methods
147+
// Create a deferred object: A pending promise with `resolve`, `fulfill` and `reject`
148+
// methods
148149
createDeferred = function () {
149150
var
150151
// Promise's current state
@@ -156,7 +157,7 @@
156157

157158
// Queues of fulfillment / rejection handlers. Handlers are added whenever the
158159
// promise's `then` method is invoked
159-
fulfilQueue = [],
160+
fulfillQueue = [],
160161
rejectQueue = [],
161162

162163
// The actual promise. The deferred will derive from this
@@ -178,7 +179,7 @@
178179
// promise is already fulfilled or as soon as (and if) that eventually happens
179180
var evaluator = createEvaluator(onFulfilled, dependantDeferred);
180181
state === "fulfilled" ? evaluateOnNextTurn(evaluator, result) :
181-
fulfilQueue.push(evaluator);
182+
fulfillQueue.push(evaluator);
182183
},
183184

184185
// Queue a handler and a dependant deferred for rejection. When (and if) the promise
@@ -201,23 +202,23 @@
201202
},
202203

203204
// Fulfil the promise. Will run the queued fulfillment-handlers and resolve
204-
// dependant promises. Note that the `fulfil` method will be exposed on the
205+
// dependant promises. Note that the `fulfill` method will be exposed on the
205206
// returned deferred *only* - not on any returned promise: not by the deferred's
206207
// underlying promise or those returned by invoking `then`
207208
fulfill = function (value) {
208209

209-
// Dont fulfil the promise unless it's currently in a pending state
210+
// Dont fulfill the promise unless it's currently in a pending state
210211
if (state !== "pending") { return; }
211212

212213
// Fulfil the promise
213214
state = "fulfilled";
214-
for (var i = 0, l = fulfilQueue.length; i < l; ++i) { fulfilQueue[i](value); }
215-
fulfilQueue = [];
215+
for (var i = 0, l = fulfillQueue.length; i < l; ++i) { fulfillQueue[i](value); }
216+
fulfillQueue = [];
216217
result = value;
217218
},
218219

219220
// Reject the promise. Will run the queued rejection-handlers and resolve
220-
// dependant promises. As with the `fulfil` method, the `reject` method will be
221+
// dependant promises. As with the `fulfill` method, the `reject` method will be
221222
// exposed on the returned deferred *only* - not on any returned promise
222223
reject = function (reason) {
223224

@@ -268,7 +269,7 @@
268269
// Attach the `defer` / `getVersion` methods to Tillthen and return it
269270
return extend(tillthen, {
270271

271-
// Get a deferred object: A pending promise with `resolve`, `fulfil` and `reject` methods
272+
// Get a deferred object: A pending promise with `resolve`, `fulfill` and `reject` methods
272273
defer: createDeferred,
273274

274275
// Get current version of Tillthen

0 commit comments

Comments
 (0)