1 | var arrayFilter = require('./_arrayFilter'),
|
2 | stubArray = require('./stubArray');
|
3 |
|
4 |
|
5 | var objectProto = Object.prototype;
|
6 |
|
7 |
|
8 | var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
9 |
|
10 |
|
11 | var nativeGetSymbols = Object.getOwnPropertySymbols;
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
21 | if (object == null) {
|
22 | return [];
|
23 | }
|
24 | object = Object(object);
|
25 | return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
26 | return propertyIsEnumerable.call(object, symbol);
|
27 | });
|
28 | };
|
29 |
|
30 | module.exports = getSymbols;
|