Skip to content

Commit

Permalink
Fixed scoping issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVerschueren committed Oct 6, 2015
1 parent c0f3877 commit a69845f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/methods/CreateTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ CreateTable.prototype.exec = function () {
var isAwait = this._await;
var awaitMs = this._awaitMs;

return pify(dynamodb.service.createTable, Promise)(params)
return pify(dynamodb.service.createTable.bind(dynamodb.service), Promise)(params)
.then(function () {
if (isAwait === true) {
// Start polling if await is set to true
Expand Down
2 changes: 1 addition & 1 deletion lib/methods/DeleteItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ DeleteItem.prototype.exec = function () {
var dynamodb = this._dynamodb;
var params = this._params;

return pify(dynamodb.delete, Promise)(params);
return pify(dynamodb.delete.bind(dynamodb), Promise)(params);
};

// Export the object
Expand Down
2 changes: 1 addition & 1 deletion lib/methods/DeleteTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ DeleteTable.prototype.exec = function () {
var isAwait = this._await;
var awaitMs = this._awaitMs;

return pify(dynamodb.service.deleteTable, Promise)(params)
return pify(dynamodb.service.deleteTable.bind(dynamodb.service), Promise)(params)
.then(function () {
if (isAwait === true) {
// If await is true, start polling
Expand Down
2 changes: 1 addition & 1 deletion lib/methods/Query.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Query.prototype.exec = function () {
var dynamodb = this._dynamodb;
var params = this._params;

return pify(dynamodb.query, Promise)(params)
return pify(dynamodb.query.bind(dynamodb), Promise)(params)
.then(function (data) {
if (params.Limit === 1) {
// If the limit is specifically set to 1, we should return the object instead of the array.
Expand Down
2 changes: 1 addition & 1 deletion lib/methods/Scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Scan.prototype.exec = function () {
var dynamodb = this._dynamodb;
var params = this._params;

return pify(dynamodb.scan, Promise)(params)
return pify(dynamodb.scan.bind(dynamodb), Promise)(params)
.then(function (data) {
if (params.Limit === 1) {
// If the limit is specifically set to 1, we should return the object instead of the array.
Expand Down
2 changes: 1 addition & 1 deletion lib/methods/UpdateItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ UpdateItem.prototype.exec = function () {
var dynamodb = this._dynamodb;
var params = this._params;

return pify(dynamodb.update, Promise)(params)
return pify(dynamodb.update.bind(dynamodb), Promise)(params)
.then(function (data) {
// Return the attributes
return data.Attributes;
Expand Down

0 comments on commit a69845f

Please sign in to comment.