From b8ed82c70c995e5581cd9126fcea0d7bbeb085a9 Mon Sep 17 00:00:00 2001 From: Jake Marsh Date: Mon, 11 May 2015 17:20:40 -0400 Subject: [PATCH] fix 'location is not defined' error --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'));