bitovi / jquerypp

jQuery's missing utils and special events
http://jquerypp.com
MIT License
1.21k stars 160 forks source link

Uncaught TypeError: undefined is not a function #31

Closed krnlde closed 12 years ago

krnlde commented 12 years ago

Hey, I found out that the compiled js files lack a semicolon at the end of the closure call (function ($) {/*...*/})(jQuery). When you now merge some files it will result in this:

(function ($) {
/*some plugin code*/
})(jQuery)
(function ($) {
/*another plugin code*/
})(jQuery)

which will file with the error defined in this issue title.

I suggest to put a semicolon before and after the closure call (this is also recommended by Mr. Crockford):

;(function ($) {
/*...*/
})(jQuery);

greets, krnl

daffl commented 12 years ago

Do you mean the separate plugin files like jquery.animate.js?

It seems to be fine in the generated full file and the ones generated by the download builder.

krnlde commented 12 years ago

Yep I'm talking about the seperate plugin files. The full file works fine.

daffl commented 12 years ago

I updated steal.pluginify to insert semicolons:

https://github.com/jupiterjs/steal/commit/14acd12915855bb4125254fa3a6c04452c5bd115

You can build your own and the files will be updated in the next release.