Skip to content

Commit 95fc049

Browse files
author
SGrondin
committed
1.9.1 Fixed issue on Node 0.10
1 parent e2820ea commit 95fc049

6 files changed

+11
-6
lines changed

bottleneck.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
return require("bluebird");
2222
} catch (_error) {
2323
e = _error;
24-
return Promise;
24+
return typeof Promise !== "undefined" && Promise !== null ? Promise : function() {
25+
throw new Error("Bottleneck: install 'bluebird' or use Node 0.12 or higher for Promise support");
26+
};
2527
}
2628
})();
2729

bottleneck.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bottleneck",
33
"main": "bottleneck.js",
4-
"version": "1.9.0",
4+
"version": "1.9.1",
55
"homepage": "https://github.com/SGrondin/bottleneck",
66
"authors": [
77
"SGrondin <github@simongrondin.name>"

lib/Bottleneck.js

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bottleneck",
3-
"version": "1.9.0",
3+
"version": "1.9.1",
44
"description": "Async rate limiter",
55
"main": "lib/index.js",
66
"scripts": {

src/Bottleneck.coffee

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
class Bottleneck
22
Bottleneck.strategy = Bottleneck::strategy = {LEAK:1, OVERFLOW:2, BLOCK:3}
33
Bottleneck.Cluster = Bottleneck::Cluster = require "./Cluster"
4-
Bottleneck.Promise = Bottleneck::Promise = try require "bluebird" catch e then Promise
4+
Bottleneck.Promise = Bottleneck::Promise = try require "bluebird" catch e then Promise ? ->
5+
throw new Error "Bottleneck: install 'bluebird' or use Node 0.12 or higher for Promise support"
56
constructor: (@maxNb=0, @minTime=0, @highWater=0, @strategy=Bottleneck::strategy.LEAK) ->
67
@_nextRequest = Date.now()
78
@_nbRunning = 0

0 commit comments

Comments
 (0)