diff --git a/lib/utils.js b/lib/utils.js index 845f84c25d..5c292479b7 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -661,7 +661,7 @@ exports.stackTraceFilter = function() { : { browser: true } , cwd = is.node ? process.cwd() + slash - : location.href.replace(/\/[^\/]*$/, '/'); + : (typeof location === 'undefined' ? window.location : location).href.replace(/\/[^\/]*$/, '/'); function isNodeModule (line) { return (~line.indexOf('node_modules'));