diff --git a/lib/utils.js b/lib/utils.js index c1393a9c62..95623c21bf 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -647,7 +647,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'));