1// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
2var toIObject = require('./_to-iobject');
3var gOPN = require('./_object-gopn').f;
4var toString = {}.toString;
5
6var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
7  ? Object.getOwnPropertyNames(window) : [];
8
9var getWindowNames = function (it) {
10  try {
11    return gOPN(it);
12  } catch (e) {
13    return windowNames.slice();
14  }
15};
16
17module.exports.f = function getOwnPropertyNames(it) {
18  return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
19};
20