wallet-core/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js

20 lines
783 B
JavaScript
Raw Normal View History

2017-08-14 05:01:11 +02:00
var Set = require('./es6.set');
var from = require('./_array-from-iterable');
var metadata = require('./_metadata');
var anObject = require('./_an-object');
var getPrototypeOf = require('./_object-gpo');
var ordinaryOwnMetadataKeys = metadata.keys;
var toMetaKey = metadata.key;
2017-05-28 00:38:50 +02:00
2017-08-14 05:01:11 +02:00
var ordinaryMetadataKeys = function (O, P) {
var oKeys = ordinaryOwnMetadataKeys(O, P);
var parent = getPrototypeOf(O);
if (parent === null) return oKeys;
var pKeys = ordinaryMetadataKeys(parent, P);
2017-05-28 00:38:50 +02:00
return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
};
2017-08-14 05:01:11 +02:00
metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {
2017-05-28 00:38:50 +02:00
return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
2017-08-14 05:01:11 +02:00
} });