Skip to content

Commit

Permalink
Removing an arguments object leak, and updating the example code in t…
Browse files Browse the repository at this point in the history
…he README file.
  • Loading branch information
dsfields committed Dec 17, 2015
1 parent 8f71c48 commit bfd97a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Usage is almost exactly the same as the native SDK, but with the added ability t
A user repository module with a simple lookup...

```js
var couchbase = require('couchbase-promises');
var cluster = new couchbase.Cluster('couchbase://127.0.0.1');
var bucket = cluster.openBucket();
let couchbase = require('couchbase-promises');
let cluster = new couchbase.Cluster('couchbase://127.0.0.1');
let bucket = cluster.openBucket();

function UserNotFoundError() {
Error.call(this);
Expand All @@ -38,7 +38,7 @@ module.exports = {
}
};
}).catch(couchbase.Error, function(e) {
if (e.code == couchbase.errors.keyNotFound)
if (e.code === couchbase.errors.keyNotFound)
throw new UserNotFoundError();

throw e;
Expand Down
5 changes: 4 additions & 1 deletion lib/promisify.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ var Promise = require('bluebird');

module.exports = function(original) {
var method = original;
var args = [].slice.call(arguments);
var args = new Array(arguments.length - 1);
for (var i = 0; i < arguments.length; i++) {
args[i] = arguments[i];
}
var self = this;
return new Promise(function(fulfill, reject) {
var ff = fulfill;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "couchbase-promises",
"longName": "Couchbase Promises",
"description": "An A+ Promises wrapper for the Couchbase SDK.",
"version": "1.0.0",
"version": "1.0.1",

"dependencies": {
"bluebird": "^3.0.5",
Expand Down

0 comments on commit bfd97a8

Please sign in to comment.