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

Concatenate JavaScripts with semicolon. #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lynaghk
Copy link

@lynaghk lynaghk commented Jan 18, 2012

Without a semicolon, JavaScript evaluates

a = b + c
(d + e).print()

as

a = b + c(d + e).print();

rather than

a = b + c;
(d + e).print();

This commit prevents that from happening by defensively adding a semicolon when joining JavaScripts.

@dnsco
Copy link

dnsco commented Feb 28, 2012

is this going to get merged? we occasionally have issues resulting from concatenation.

@dougcole
Copy link

This seems really valuable - is anything holding this up?

@andrewhao
Copy link

What compressors are you all using? By explicitly requiring Closure Compiler this issue went away for me (methinks JSMin uses a naive compression algorithm?).

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

Successfully merging this pull request may close these issues.

4 participants