typicode / fetchival

Easy window.fetch requests
MIT License
522 stars 33 forks source link

`fetchival.fetch` throws an `Illegal invocation` error #1

Closed leonderijke closed 9 years ago

leonderijke commented 9 years ago

Tested in Chrome 42, which has native support for fetch and ES6 Promises: http://codepen.io/leonderijke/pen/pJjdxj?editors=001

When calling fetchival('/foo').get(), fetchival.fetch throws an Illegal invocation TypeError.

Running the tests in Chrome 42 gives the same result: all tests fail with TypeError: Illegal invocation.

typicode commented 9 years ago

Thanks for raising this issue. Should be good with v0.1.2

fetch wasn't called with the right context. I've added .bind(window)

leonderijke commented 9 years ago

Yes, confirming that this error is fixed. Thanks!