medikoo / es5-ext

ECMAScript extensions (with respect to upcoming ECMAScript features)
ISC License
168 stars 81 forks source link

Fix typos causing invalid IIFEs #53

Closed ntilwalli closed 7 years ago

ntilwalli commented 7 years ago

I noticed these IIFE typos while trying to bundle this library using rollup.

medikoo commented 7 years ago

It was written that way intentionally, why do you feel it should be changed?

ntilwalli commented 7 years ago

I'm using rollup to bundle my app dependencies and commonjs-rollup-plugin errors with unexpected token errors when the code has the current style. With the proposed style rollup has no issues.

I actually had never seen that style before and when I tried a simple IIFE example which places the function call parens immediately after the closing brace both node and chrome error out. Is there a reason you chose that style?

ntilwalli commented 7 years ago

Correction: the current style works in chrome and node. I tested function () {}() when I should have tested (function() {}()).

I'll withdraw. This qualifies as a commonjs-rollup-plugin issue.

medikoo commented 7 years ago

Yes, there's no issue with that. It might be related to some micro-optimization idea, that emerged recently. Still I don't believe it can bring any noticeable gain (even when speaking of single milliseconds)