diff --git a/src/messages.js b/src/messages.js index cc170aa..680496b 100644 --- a/src/messages.js +++ b/src/messages.js @@ -6,16 +6,17 @@ Messages.registerProvider = function (providerName, obj) { this.Providers[providerName] = obj; }; -Messages.setProvider = function (provider, options) { - let providerObj = this.Providers[provider]; +Messages.setProvider = function (providerName, options) { + let provider = this.Providers[providerName]; - if (!providerObj) { + if (!provider) { throw new Error('Unknown messages provider'); } - this.currentMessages = providerObj; + this.currentProviderName = providerName; + this.currentMessages = provider; - return providerObj.setProvider(options); + return provider.setProvider(options); }; Messages.isAvailable = function () { diff --git a/src/names.js b/src/names.js index 9d95abc..0431e68 100644 --- a/src/names.js +++ b/src/names.js @@ -7,16 +7,17 @@ Names.registerProvider = function (providerName, obj) { Names.Providers[providerName] = obj; }; -Names.setProvider = function (provider, options) { - let providerObj = this.Providers[provider]; +Names.setProvider = function (providerName, options) { + let provider = this.Providers[providerName]; - if (!providerObj) { + if (!provider) { throw new Error('Unknown name system provider'); } - this.currentNameSystems = providerObj; + this.currentProviderName = providerName; + this.currentNameSystems = provider; - return providerObj.setProvider(options); + return provider.setProvider(options); }; // resolve resolves a name into an identifier of some kind diff --git a/src/storage.js b/src/storage.js index de3455f..6e8086e 100644 --- a/src/storage.js +++ b/src/storage.js @@ -51,16 +51,17 @@ Storage.registerProvider = function (providerName, obj) { this.Providers[providerName] = obj; }; -Storage.setProvider = function (provider, options) { - let providerObj = this.Providers[provider]; +Storage.setProvider = function (providerName, options) { + let provider = this.Providers[providerName]; - if (!providerObj) { + if (!provider) { throw new Error('Unknown storage provider'); } - this.currentStorage = providerObj; + this.currentProviderName = providerName; + this.currentStorage = provider; - return providerObj.setProvider(options); + return provider.setProvider(options); }; Storage.isAvailable = function () {