Skip to content

Commit ad37f5b

Browse files
committed
When running under nodejs location is undefined, correct isSameDomain to not throw exception.
1 parent 975e391 commit ad37f5b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stacktrace.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ printStackTrace.implementation.prototype = {
325325
* @return False if we need a cross-domain request
326326
*/
327327
isSameDomain: function(url) {
328+
if (typeof(location) === "undefined")
329+
return false;
328330
return url.indexOf(location.hostname) !== -1;
329331
},
330332

0 commit comments

Comments
 (0)