Skip to content

Don't set window.cp global if exports exists #1

Closed
ryanwilliams opened this Issue Jan 16, 2012 · 1 comment

2 participants

@ryanwilliams

Hi,

In my opinion CP shouldn't set the window.cp global if module.exports exists. i.e. If someone is using commonJS module system, they probably don't want the global being there and will instead 'require' in the lib as needed.

So the top should look something like:

var cp;
if(typeof exports === 'undefined'){
    cp = {};
    if(typeof window === 'object'){
        window.cp = cp;
    }
} else {
    cp = exports;
}
@josephg josephg added a commit that referenced this issue Jan 16, 2012
@josephg Fixed issue #1 7d9068c
@josephg
Owner
josephg commented Jan 16, 2012

Good point. Fixed.

@josephg josephg closed this Jan 16, 2012
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.