Skip to content

Conversation

@marifehe
Copy link

This is needed for AdapterJS to be able to pick values that have been set before it is required or imported, otherwise the var AdapterJS = ... itself is already overwriting whatever was in the global variable.
It is interpreted as:

var AdaptjerJS;
AdaptjerJS = AdapterJS || {};

Accessing through window solves the issue.
Does it make sense to you?

@johache
Copy link
Contributor

johache commented Jan 19, 2017

LGTM.
@Letchoo any objections ?

@marifehe marifehe changed the title get config values from global object #69 get config values from global object related to issue #69 Jan 19, 2017
@marifehe
Copy link
Author

marifehe commented Jan 19, 2017

Actually, I think the way I did it, the real AdapterJS would be available in global scope. What do you think about getting only a copy of the config values with
var AdapterJS = (window && window.AdapterJS && JSON.parse(JSON.stringify(window.AdapterJS))) || {}; ?

This way the real AdapterJS truly remains local and won't be available in the global scope.

@marifehe
Copy link
Author

Will it be possible to merge this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants