Skip to content

Commit bfd97a8

Browse files
committed
Removing an arguments object leak, and updating the example code in the README file.
1 parent 8f71c48 commit bfd97a8

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Usage is almost exactly the same as the native SDK, but with the added ability t
1616
A user repository module with a simple lookup...
1717

1818
```js
19-
var couchbase = require('couchbase-promises');
20-
var cluster = new couchbase.Cluster('couchbase://127.0.0.1');
21-
var bucket = cluster.openBucket();
19+
let couchbase = require('couchbase-promises');
20+
let cluster = new couchbase.Cluster('couchbase://127.0.0.1');
21+
let bucket = cluster.openBucket();
2222

2323
function UserNotFoundError() {
2424
Error.call(this);
@@ -38,7 +38,7 @@ module.exports = {
3838
}
3939
};
4040
}).catch(couchbase.Error, function(e) {
41-
if (e.code == couchbase.errors.keyNotFound)
41+
if (e.code === couchbase.errors.keyNotFound)
4242
throw new UserNotFoundError();
4343

4444
throw e;

lib/promisify.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ var Promise = require('bluebird');
44

55
module.exports = function(original) {
66
var method = original;
7-
var args = [].slice.call(arguments);
7+
var args = new Array(arguments.length - 1);
8+
for (var i = 0; i < arguments.length; i++) {
9+
args[i] = arguments[i];
10+
}
811
var self = this;
912
return new Promise(function(fulfill, reject) {
1013
var ff = fulfill;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "couchbase-promises",
33
"longName": "Couchbase Promises",
44
"description": "An A+ Promises wrapper for the Couchbase SDK.",
5-
"version": "1.0.0",
5+
"version": "1.0.1",
66

77
"dependencies": {
88
"bluebird": "^3.0.5",

0 commit comments

Comments
 (0)