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

Using $ for mangled function names conflicts with jQuery #36

Closed
rivol opened this issue Sep 30, 2012 · 2 comments
Closed

Using $ for mangled function names conflicts with jQuery #36

rivol opened this issue Sep 30, 2012 · 2 comments
Assignees

Comments

@rivol
Copy link

rivol commented Sep 30, 2012

I have a "class" function with many subfunctions inside of it. When compressing it with Slimit, the function name mangling uses $ and _ for function names which results in errors because I am using jQuery and expect $ to remain reserved for jQuery.

See the testcase at https://gist.github.com/3806569
Names of functions 52 and 53 are mangled to $ and _ which breaks jQuery usage.

$ and _ are both used by popular JS libraries (jQuery and Underscore.js) so I'd suggest not to use them for function names.

Removing those 2 chars from ID_CHARS in scope.py fixes the problem for me, but I don't know if it might have any side effects.

@ghost ghost assigned rspivak Oct 2, 2012
@rspivak
Copy link
Owner

rspivak commented Oct 2, 2012

Thanks for filing the issue. I'll look into it.

@rspivak
Copy link
Owner

rspivak commented Mar 23, 2013

Fixed in ada895e

@rspivak rspivak closed this as completed Mar 23, 2013
lelit pushed a commit to lelit/slimit that referenced this issue Feb 9, 2014
acatton pushed a commit to acatton/fork--rspivak--slimit that referenced this issue Jan 26, 2015
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