groupon / assertive

Assertive is a terse yet expressive assertion library
BSD 3-Clause "New" or "Revised" License
21 stars 11 forks source link

Change bind for partial in order to support non ECMAScript 5 environments #23

Closed rduenasf closed 9 years ago

rduenasf commented 9 years ago

Issue: While using assertive with PhantomJS 1.9.X, I was getting the following errors:

message: >
    'undefined' is not a function (evaluating 'isType.bind(this, value)')
stack: >
    TypeError: 'undefined' is not a function (evaluating 'isType.bind(this, value)')
        at http://localhost:7357/node_modules/assertive/lib/assertive.js:324
        at http://localhost:7357/node_modules/assertive/lib/assertive.js:274
        at http://localhost:7357/test/tmp/client/deal_builder/frontend/campaignApi.js:17

Cause: PhantomJS 1.9.X doesn't support ECMAScript 5, therefore doesn't support bind, causing the failure.

Solution: Replace bind for _.partial

Notes: I wasn't sure what kind of test to add for this kind of fix, any recommendations?

jkrems commented 9 years ago

Thanks! I'd personally say that adding a test for this might be out of scope of this PR (since it would kind of require running our tests on CI in phantomjs). LGTM!

(Deferring the merge & release to @khoomeister since he's already on it.)

johan commented 9 years ago

:+1: here too, and copying that. :)

ghost commented 9 years ago

Hey @rduenasf, sorry can you rebase against latest? The js file is probably the only thing that'll complain since we switched from redux back to normal coffeescript.

rduenasf commented 9 years ago

@khoomeister done :+1:

ghost commented 9 years ago

Thanks!

ghost commented 9 years ago

Published as v2.0.2