cjohansen/Sinon.JS — pull request #515 by mroderick (2014-07-16 07:35:50+00:00)
Title: Fix isssues #508 #511

By using `self` (and detecting the presence of it for NodeJS's benefit), the problem of detecting the global scope in Web Workers and in regular browser environments go away.

See
* https://developer.mozilla.org/en-US/docs/Web/API/Window.self
* http://www.w3.org/TR/workers/#the-global-scope

This fixes #508 and #511