source: imaps-frontend/node_modules/core-js/modules/esnext.reflect.get-metadata.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.1 KB
Line 
1'use strict';
2// TODO: Remove from `core-js@4`
3var $ = require('../internals/export');
4var ReflectMetadataModule = require('../internals/reflect-metadata');
5var anObject = require('../internals/an-object');
6var getPrototypeOf = require('../internals/object-get-prototype-of');
7
8var ordinaryHasOwnMetadata = ReflectMetadataModule.has;
9var ordinaryGetOwnMetadata = ReflectMetadataModule.get;
10var toMetadataKey = ReflectMetadataModule.toKey;
11
12var ordinaryGetMetadata = function (MetadataKey, O, P) {
13 var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
14 if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);
15 var parent = getPrototypeOf(O);
16 return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
17};
18
19// `Reflect.getMetadata` method
20// https://github.com/rbuckton/reflect-metadata
21$({ target: 'Reflect', stat: true }, {
22 getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {
23 var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]);
24 return ordinaryGetMetadata(metadataKey, anObject(target), targetKey);
25 }
26});
Note: See TracBrowser for help on using the repository browser.