开发者

jQuery UI: Two semicolons after logical expression with function wrapper

开发者 https://www.devze.com 2022-12-28 10:23 出处:网络
I was looking at some jQuery UI code, a found a weird behavior there: jQuery.ui||(function(a){ /*... */ })(jQuery);;

I was looking at some jQuery UI code, a found a weird behavior there:

jQuery.ui||(function(a){ /*... */ })(jQuery);;

The logical OR is clear for me, the function wrapper (still searching the correct name for it), too, but why two开发者_Go百科 semicolons?

Thanks in advance

Vincent

EDIT: Just found a another weird thing: In the version on google apis is only one semicolon. But when you create your on build on http://jqueryui.com/download, there are two semicolons.


Breaking it down:

// make sure that any previous statements are properly closed
// this is handy when concatenating files, for example
; 
// Call the jQuery.ui object, or, if it does not exist, create it
jQuery.ui || (function($) { 

reference


Typo? I cannot think of any valid reason.


That must either be a bug or a misunderstanding. Two consecutive semicolons do not make sense.

0

精彩评论

暂无评论...
验证码 换一张
取 消