Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
784 bytes
|
Line | |
---|
1 | /* eslint-disable es/no-object-getownpropertynames -- safe */
|
---|
2 | var toIndexedObject = require('../internals/to-indexed-object');
|
---|
3 | var $getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
|
---|
4 |
|
---|
5 | var toString = {}.toString;
|
---|
6 |
|
---|
7 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
---|
8 | ? Object.getOwnPropertyNames(window) : [];
|
---|
9 |
|
---|
10 | var getWindowNames = function (it) {
|
---|
11 | try {
|
---|
12 | return $getOwnPropertyNames(it);
|
---|
13 | } catch (error) {
|
---|
14 | return windowNames.slice();
|
---|
15 | }
|
---|
16 | };
|
---|
17 |
|
---|
18 | // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
|
---|
19 | module.exports.f = function getOwnPropertyNames(it) {
|
---|
20 | return windowNames && toString.call(it) == '[object Window]'
|
---|
21 | ? getWindowNames(it)
|
---|
22 | : $getOwnPropertyNames(toIndexedObject(it));
|
---|
23 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.