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

noConflict does not solve all conflicts #33

Open
mcasimir opened this issue Aug 21, 2015 · 3 comments
Open

noConflict does not solve all conflicts #33

mcasimir opened this issue Aug 21, 2015 · 3 comments

Comments

@mcasimir
Copy link

Hi buddy,
this is not enough:

    oldClass          = context.Class;                                         // save current Class namespace
    context.Class     = Class;                                                 // bind Class and jsface to global scope
    context.jsface    = jsface;
    jsface.noConflict = function() { context.Class = oldClass; };              // no conflict

noConflict "pattern" should allow to preserve global context from pollution completely, you'll need to backup and return jsface too:

    oldClass          = context.Class;                                       // save current Class namespace
    context.Class     = Class;                                                 // bind Class and jsface to global scope
    var oldJsface     = context.jsface;
    context.jsface    = jsface;
    jsface.noConflict = function() { 
       context.Class = oldClass;
       context.jsface = oldJsface;  
       return jsface; 
    };              // no conflict

Now people can use noConflict like this:

var Class = jsface.noConflict().Class;

If you review this comment I can make a PR for you.

@mcasimir
Copy link
Author

Actually was too easy to submit a PR: #34

@n9986
Copy link

n9986 commented Mar 30, 2016

Is this project dead?

@tnhu
Copy link
Owner

tnhu commented Apr 8, 2016

@mcasimir, I think it's overdone to save and restore jsface. Given development of tooling like webpack and browsersify, commonjs is now supported when you develop javascript for front-end, noConflict becomes less and less useful.

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

3 participants