no-context / moo

Optimised tokenizer/lexer generator! 🐄 Uses /y for performance. Moo.
BSD 3-Clause "New" or "Revised" License
821 stars 65 forks source link

Fix for breaking compilers #82

Closed devotox closed 5 years ago

devotox commented 6 years ago

it just needs a semicolon at the end

tjvr commented 6 years ago

Hello, please can you explain this change? Thanks! :)

devotox commented 6 years ago

When a compiler like Uglify JS tries to concatenate the files this causes a problem when a semicolon does not finish off the last function. I was adding your plugin into an Ember JS application and noticed this behaviour. Adding the semicolon fixed said issue

Best regards, Devonte Emokpae

Software Solutions Architect Zen__

"Meeting all your software solutions needs"

M: +44 7447 903 346 G: Github L: LinkedIn W: Stack Overflow E: me@devonte.io

On 20 Nov 2017, 16:35 +0000, Tim (blob8108) notifications@github.com, wrote:

Hello, please can you explain this change? Thanks! :) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

tjvr commented 6 years ago

How are you passing the files to UglifyJS? Are you concatenating them onto its stdin, or listing them as arguments on the command-line?

devotox commented 6 years ago

Ember JS is automatically passing them in. i do not actually know the internals but what i do see is that it takes this function plus anything next and seems to add it as one when the semicolon was not there

nathan commented 6 years ago

@devotox in addition to this issue, you should probably report this as a bug in whatever tool you are using since it's turning valid JS into invalid JS

(Ah, the good old days of https://github.com/twbs/bootstrap/issues/3057 :P)

devotox commented 6 years ago

@nathan gottaaaa love those days loool