Incorrect semicolons in code

4 views
Skip to first unread message

anrikun

unread,
Dec 26, 2010, 1:14:07 PM12/26/10
to Jcrop Development Discussion
First of all, thank you very much for this great plugin!

The following syntax is used throughout plugin code and is incorrect
AFAIK:

function myfunction()
{
...
}; // this semicolon should be removed.



The correct syntax is whether:

function myfunction()
{
...
}

or:

var myfunction = function()
{
...
};



By the way, are you open to patches?

Kelly Hallman

unread,
Dec 26, 2010, 2:07:20 PM12/26/10
to jcro...@googlegroups.com
Thanks for your input. I picked up this habit at some point, but your post made me re-examine the issue. So far, what I have found does not suggest this is per se "wrong" but in the cases you mention it may be extraneous.

I turned on javascript.options.strict in Firefox, and it did not complain about the semi-colons. However, I also tried to craft some cases to break the interpretation without using semi-colons and I think you are correct that it is only requisite when assigning a function to a variable.

I'll consult with my gurus and see if I can find a consensus on this particular practice. Was it causing you any particular problems or errors?

I am open to patches. If it helps, I have an official github repository here: https://github.com/tapmodo/jcrop - this has not been publicly advertised yet, but I plan to maintain the plugin there going forward.

Right now, the repository contains the most current version of the code, which will form the basis for the next release.

Keep in touch!
-Kelly



--
You received this message because you are subscribed to the Google Groups "Jcrop Development Discussion" group.
To post to this group, send email to jcro...@googlegroups.com.
To unsubscribe from this group, send email to jcrop-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jcrop-dev?hl=en.


Reply all
Reply to author
Forward
0 new messages