Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Make getGlobal() work in strict mode #317

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+6 −5
Split
View
@@ -51,12 +51,13 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
*/
jasmine.CATCH_EXCEPTIONS = true;
+/**
+ * ECMAScript 5 strict mode doesn't promote undefined to the global object,
+ * so if you want to run jasmine in strict mode, this is the only way to
+ * get the global obje
+jasmine.global = this;
jasmine.getGlobal = function() {
- function getGlobal() {
- return this;
- }
-
- return getGlobal();
+ return jasmine.global;
};
/**