main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 2 weeks ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
864 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | 'use strict';
|
---|
| 2 | /* eslint-disable es/no-object-getownpropertynames -- safe */
|
---|
| 3 | var classof = require('../internals/classof-raw');
|
---|
| 4 | var toIndexedObject = require('../internals/to-indexed-object');
|
---|
| 5 | var $getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
|
---|
| 6 | var arraySlice = require('../internals/array-slice');
|
---|
| 7 |
|
---|
| 8 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
---|
| 9 | ? Object.getOwnPropertyNames(window) : [];
|
---|
| 10 |
|
---|
| 11 | var getWindowNames = function (it) {
|
---|
| 12 | try {
|
---|
| 13 | return $getOwnPropertyNames(it);
|
---|
| 14 | } catch (error) {
|
---|
| 15 | return arraySlice(windowNames);
|
---|
| 16 | }
|
---|
| 17 | };
|
---|
| 18 |
|
---|
| 19 | // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
|
---|
| 20 | module.exports.f = function getOwnPropertyNames(it) {
|
---|
| 21 | return windowNames && classof(it) === 'Window'
|
---|
| 22 | ? getWindowNames(it)
|
---|
| 23 | : $getOwnPropertyNames(toIndexedObject(it));
|
---|
| 24 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.