Don't assume exports is defined when window is undefined
The current code makes the assumption that if window is undefined it is being run in an environment which supports the CommonJS Modules spec. This is not the case when Jasmine is being run in rhino or SpiderMonkey (smjs) without EnvJS. The fix is simply to check that exports is an object. Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
This commit is contained in:
committed by
Davis W. Frank & Rajan Agaskar
parent
c5ba032d28
commit
26f0f6f213
@@ -1,4 +1,4 @@
|
||||
var isCommonJS = typeof window == "undefined";
|
||||
var isCommonJS = typeof window == "undefined" && typeof exports == "object";
|
||||
|
||||
/**
|
||||
* Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var isCommonJS = typeof window == "undefined";
|
||||
var isCommonJS = typeof window == "undefined" && typeof exports == "object";
|
||||
|
||||
/**
|
||||
* Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
|
||||
|
||||
Reference in New Issue
Block a user