Don't copy and paste Ember min source

So a friend of a friend (it was me) was lazy and copied and pasted ember-1.0.0-rc.6.1.min.js source from the browser… Obviously a good lazy mistake. Unfortunately the minifier minifies \u00AD (­) down to its unicode (2 bytes) form which does not copy and paste properly from browser to editor, resulting in invalid code. I almost thought it was a bug in ember, but really it was just me. Maybe by default the minified version should download instead of opening in page. If you’re interested, the ­ guy is used for sneaking the script tags in as the first element in innerHTML for pre IE9 browsers.

Per the code: Internet Explorer prior to 9 does not allow setting innerHTML if the first element is a “zero-scope” element. This problem can be worked around by making the first node an invisible text node. We, like Modernizr, use ­

The moral of this story is, don’t copy and paste ember-min source. Right Click, download, replace the file.

My random tidbit of knowledge for the day

Out of curiosity, are you on Windows, Mac, or Linux?

Huh - we had that bug ourselves, and I did in fact copy and paste the minified source code. I’ll try re-downloading it now and see if the bug goes away. I’m on a Mac using Safari, FWIW.

I use a Mac too, I could have sworn I’ve copied and pasted the minified code but maybe I haven’t. Maybe it’s also an editor issue.

It worked in Vim at home from Chrome. I’ll have to try it again at work, it was on Visual Studio at work from Chrome. It wouldn’t surprise me if it was the editor, VS is far from useful when you’re doing javascript.

1 Like

I always use wget (with --output-document=downloaded-lib.js in case of an update) , it’s much faster, and I never had a issue with it.

It was resharper in VS. Good ol’ resharper, I miss Vim in Windows… It isn’t the same.