github/fetch — pull request #49 by matthew-andrews (2014-12-24 18:11:07+00:00)
Title: Put back an object for the fetch polyfill can hook into in a node context

Because `this` cannot be overridden inside node context (node is silly an 'this' _isn't_ the global object, as per frontend JS) [this PR](https://github.com/github/fetch/pull/48) breaks https://github.com/matthew-andrews/isomorphic-fetch (and this fetch in Node in general by making fetch a private method).

You know I really don't like polluting front end modules with server side stuff but otherwise PR 48 renders this library unusable which has to be worse than a little pollution… :disappointed:

This line will detect the Node specific 'global' object and add itself to that if it detects it.

I've prepared two PRs with two possible solutions, this one is a bit nicer from a node point of view and allows the isomorphic fetch library to do slightly less — the other is slightly better from a frontend point of view because it sort of at least does _something_ in the front end, even if that thing is a bit pointless…