sukima / ember-cli-select-picker

An enhanced Boostrap styled select component addon for Ember CLI
https://sukima.github.io/ember-cli-select-picker
MIT License
23 stars 15 forks source link

Fix the addon for PhantomJS and IE10 #7

Closed arkadiyk closed 9 years ago

arkadiyk commented 9 years ago

function.bind is undefined for PhantomJS. ember test shows this error:

 message: >
         'undefined' is not a function (near '...}).bind(this));...')
johnnyshields commented 9 years ago

@sukima I'm merging this as its safe to merge.

sukima commented 9 years ago

:rage1: This very problem bit me in another ember project I'm working with. In that case I added the es5-shim.js to tests/index.html to keep the actual code readable. Personally the fact that the JavaScriptCore (the engine PhantomJS uses) team implemented all the ES5 API except Function.prototype.bind is a gross and underhanded choice. I sham Apple for that.

Fascinatingly enough, the 6to5 transpiler that Ember-CLI uses doesn't include ES5 poly fills! That's just more crazy-sauce! It does however include ES6 thin/fat arrow syntax which, like CoffeeScript, will give you an implicit bind.

Like a famous singer once put it: "This :poop: is :banana: B-A-N-A-N-A-S!"