[Build] Use native bind

...in CouchPersistenceProvider and ElasticPersistenceProvider, per
https://github.com/nasa/openmct/pull/724#issuecomment-193542314
This commit is contained in:
Victor Woeltjen
2016-04-08 16:25:32 -07:00
parent 0b11ddbcfd
commit f6a9c90cef
2 changed files with 8 additions and 20 deletions

View File

@ -58,12 +58,6 @@ define(
this.path = path;
}
function bind(fn, thisArg) {
return function () {
return fn.apply(thisArg, arguments);
};
}
// Issue a request using $http; get back the plain JS object
// from the expected JSON response
ElasticPersistenceProvider.prototype.request = function (subpath, method, value, params) {
@ -141,11 +135,11 @@ define(
ElasticPersistenceProvider.prototype.createObject = function (space, key, value) {
return this.put(key, value).then(bind(this.checkResponse, this));
return this.put(key, value).then(this.checkResponse.bind(this));
};
ElasticPersistenceProvider.prototype.readObject = function (space, key) {
return this.get(key).then(bind(this.getModel, this));
return this.get(key).then(this.getModel.bind(this));
};
ElasticPersistenceProvider.prototype.updateObject = function (space, key, value) {
@ -158,7 +152,7 @@ define(
};
ElasticPersistenceProvider.prototype.deleteObject = function (space, key) {
return this.del(key).then(bind(this.checkResponse, this));
return this.del(key).then(this.checkResponse.bind(this));
};
return ElasticPersistenceProvider;