AdapterJS icon indicating copy to clipboard operation
AdapterJS copied to clipboard

get config values from global object related to issue #69

Open marifehe opened this issue 8 years ago • 3 comments

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?

marifehe avatar Jan 19 '17 04:01 marifehe

LGTM. @letchoo any objections ?

johache avatar Jan 19 '17 04:01 johache

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 avatar Jan 19 '17 19:01 marifehe

Will it be possible to merge this? :)

marifehe avatar Dec 20 '17 19:12 marifehe