petkaantonov/bluebird — pull request #40 by benjamingr (2013-12-04 10:16:26+00:00)
Title: Update global.js to correctly identify globals

This commit fixes a problem with Firefox extensions. when we did `var Error = global.Error;` Error bacame undefined because `window` is not the global context in that scenario.

Steps to reproduce the issue solved:

- Create a new Firefox extension
- import Bluebird
- An error occurs in `inherits`, that error stems from Parent being undefined, which in that case is Error.

How this solves the issue:

In firefox extensions you can still access the global scope through window with `window.wrappedJSObject`. When we detect global - we now check for this.