Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Invalid removal of parentheses of immediately called function #28

rivol opened this Issue · 3 comments

2 participants


Consider this JS snippet:

(function($) {
    $.hello = 'world';

The result of running Slimit on it is:


which is invalid JS. The outer parentheses are required here, so Slimit shouldn't remove them.

The real-world issue that I stumbled upon was with jQuery Timeago plugin:
It's using the above-mentioned construct and slimit is unable to pack it :-(

@rspivak rspivak was assigned

Thanks for the bug report. I'll look into this.


Fixed in 9408549

I've also uploaded a new version of Slimit 0.6.2 to PyPI. Let me know if you have any other issues and thanks again.

@rspivak rspivak closed this

Wow, thanks a lot for the quick response :-)
I can confirm that 0.6.2 works fine and resolves my issues.

@acatton acatton referenced this issue from a commit in acatton/slimit
@rspivak Bug fix - rspivak#28 edddd9e
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.