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

Class.$noConflict doesn't work #7

Open
SeyelentEco opened this issue Apr 13, 2011 · 0 comments
Open

Class.$noConflict doesn't work #7

SeyelentEco opened this issue Apr 13, 2011 · 0 comments

Comments

@SeyelentEco
Copy link
Contributor

I'm trying to use Prototype and Classy in the same project, and I ran into an issue with Classy's Class.$noConflict.

I looked into it, and essentially there's a bug in the "old_class = Class" line. Essentially, this assumes that since at this point Class hasn't been defined by Classy, "Class" refers to whatever object is currently using it.

However, because of variable hoisting in JavaScript, the Class variable is actually defined at the beginning of the block. If you debug using Firebug or similar, you will see that Class is undefined, even though it's defined outside the block.

Changing "old_class = Class" to "old_class = root.Class" fixes the issue.

I'm kind of new to GitHub, so I would fork and send you a patch, but this is an easy enough fix.

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

1 participant