pivotal/jasmine — pull request #503 by mmocny (2014-01-17 16:03:18+00:00)
Title: Support running jasmine within CSP (remove eval)

The jasmine.getGlobal method was recently changed (post 2.0-rc5) (https://github.com/pivotal/jasmine/pull/437) to support working within javascript 'strict' mode. However, that fix broke running jasmine from within CSP (content security policy) mode, which is gaining popularity (such as within chrome / firefox packaged apps).

This pull request fixes the issue by binding the global 'this' early (using an anonymous function wrapper instead of a global variable, since that was a previously proposed solution that was disliked), allowing the removal of eval.

The diff delow looks busy, but its mostly an indentation change. All that really changes is a trivial re-definition of getGlobal(), and the addition of a function wrapper around the assignment to base.