Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Remove global state #111

Dignifiedquire opened this Issue · 2 comments

2 participants


I've noticed a problem with log4js. It relies heavily on global state, i.e. if I configure something on the log4js object it gets set on the original object. This can lead to problems if one has multiple versions in a large application (e.g. one from a dependency and the one used by the main program).
I propose to just create a log4js object and just returning a new instance of this object. This way the responsibility to hold this new instance is with the right person, i.e. the one that called and one can easily load multiple versions of log4js into to the same application.
If you are interested I can provide a PR for this as I will do anyhow to future proof Testacular.

@Dignifiedquire Dignifiedquire referenced this issue in karma-runner/karma

Reorganize Testacular #158


@nomiddlename Any thoughts on this?


I thought node's module caching was based on the path to the module - wouldn't the different versions of log4js be different modules, with different module state? Do you have a test case or something where a module loaded via node_modules conflicted with another one in a different module?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.