Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

ryanwilliams opened this issue Jan 16, 2012 · 1 comment

Comments

@ryanwilliams
Copy link

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 added a commit that referenced this issue Jan 16, 2012
@josephg
Copy link
Owner

josephg commented Jan 16, 2012

Good point. Fixed.

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

No branches or pull requests

2 participants