Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pyxarez committed Aug 8, 2018
1 parent cf7977f commit 7febdd2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/utils/getWindowOf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import global from '../shims/global.js';
/**
* Checks that target has a defaultView
* @param {Object} target
* @return {Boolean}
* @returns {boolean}
*/
function checkDefaultViewExisting(target) {
const simplyExists = target
&& target.ownerDocument
&& target.ownerDocument.defaultView;
const simplyExists = target &&
target.ownerDocument &&
target.ownerDocument.defaultView;

/**
/**
* That case will work when target is an element inside of detached iframe.
* In Chrome it will end up with null by "target.ownerDocument.defaultView" path
* but in IE11 it will become a window with bunch of undefined properties so
* we should follow the duck typing way.
*/
const nonEmptyWindow = !!(simplyExists && target.ownerDocument.defaultView.Object);
const nonEmptyWindow = !!(simplyExists && target.ownerDocument.defaultView.Object);

return nonEmptyWindow;
return nonEmptyWindow;
}

/**
Expand All @@ -31,9 +31,9 @@ export default target => {
// Assume that the element is an instance of Node, which means that it
// has the "ownerDocument" property from which we can retrieve a
// corresponding global object.
var ownerGlobal = checkDefaultViewExisting(target)
? target.ownerDocument.defaultView
: null;
const ownerGlobal = checkDefaultViewExisting(target) ?
target.ownerDocument.defaultView :
null;

// Return the local global object if it's not possible extract one from
// provided element.
Expand Down

0 comments on commit 7febdd2

Please sign in to comment.