Skip to content

Commit

Permalink
Merge pull request #23 from paulroub/fix-es5
Browse files Browse the repository at this point in the history
Fix ES5 compatibility per #21
  • Loading branch information
Rogier Schouten authored Mar 13, 2019
2 parents d2be129 + 51a2b4b commit 3659c75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"node": true, // Enable globals available when code is running inside of the NodeJS runtime environment.
"browser": true, // Standard browser globals e.g. `window`, `document`.
"esnext": true, // Allow ES.next specific features such as `const` and `let`.
"esnext": false, // Allow ES.next specific features such as `const` and `let`.
"bitwise": false, // Prohibit bitwise operators (&, |, ^, etc.).
"camelcase": false, // Permit only camelcase for `var` and `object indexes`.
"curly": false, // Require {} for every new block or scope.
Expand All @@ -20,7 +20,8 @@
"globals": { // Globals variables.
"jasmine": true,
"angular": true,
"ApplicationConfiguration": true
"ApplicationConfiguration": true,
"Promise": true
},
"predef": [ // Extra globals.
"define",
Expand Down
5 changes: 2 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ AsyncLock.prototype.acquire = function (key, fn, cb, opts) {
cb = null;

// will return a promise
deferred = new this.Promise((resolve, reject) => {
deferred = new this.Promise(function(resolve, reject) {
deferredResolve = resolve;
deferredReject = reject;
});
Expand Down Expand Up @@ -209,7 +209,7 @@ AsyncLock.prototype._acquireBatch = function (keys, fn, cb, opts) {
fnx(cb);
}
else {
return new this.Promise((resolve, reject) => {
return new this.Promise(function (resolve, reject) {
// check for promise mode in case keys is empty array
if (fnx.length === 1) {
fnx(function (err, ret) {
Expand Down Expand Up @@ -253,4 +253,3 @@ AsyncLock.prototype._promiseTry = function(fn) {
};

module.exports = AsyncLock;

0 comments on commit 3659c75

Please sign in to comment.