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

Modules and ! sign recommendation #84

Closed
dmi3y opened this issue Sep 30, 2013 · 3 comments
Closed

Modules and ! sign recommendation #84

dmi3y opened this issue Sep 30, 2013 · 3 comments

Comments

@dmi3y
Copy link

dmi3y commented Sep 30, 2013

I believe there is mistype for ! sign recommendation on modules section. Actually I could not see how exclamation sign could help you in case missing semicolon. The following example will through error.

function abc() {} abc() !function bca() {}();

It would be much helpful to advice put ';' sign instead

function abc() {} abc() ;(function bca() {})();

and

function abc() {} abc(); ;(function bca() {})();

both equally safe for minification/concatenation.

Best

@hshoff
Copy link
Member

hshoff commented Sep 30, 2013

Hey @dmi3y thanks for checking out the guide!

This has come up before and @reissbaker explains it here: #44 (comment)

This won't work:

function abc() {} abc() !function bca() {}();

but this will work:

function abc() {} abc()
!function bca() {}();

I've added a link to @reissbaker's comment in the modules section here: c8442b4

🍻

@hshoff hshoff closed this as completed Sep 30, 2013
@dmi3y
Copy link
Author

dmi3y commented Oct 1, 2013

Thanks Harrison,

Sorry for missing that conversation.
This makes sense in that context, I've learn something new today:).
Possibly as soon this is a general javascript recommendations it might be useful to put proviso, so people did not tipped out here, like me did.

Best

@dmi3y
Copy link
Author

dmi3y commented Oct 1, 2013

Oh, you already did 👍

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