main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1006 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | // TODO: Remove from `core-js@4`
|
---|
3 | var $ = require('../internals/export');
|
---|
4 | var ReflectMetadataModule = require('../internals/reflect-metadata');
|
---|
5 | var anObject = require('../internals/an-object');
|
---|
6 | var getPrototypeOf = require('../internals/object-get-prototype-of');
|
---|
7 |
|
---|
8 | var ordinaryHasOwnMetadata = ReflectMetadataModule.has;
|
---|
9 | var toMetadataKey = ReflectMetadataModule.toKey;
|
---|
10 |
|
---|
11 | var ordinaryHasMetadata = function (MetadataKey, O, P) {
|
---|
12 | var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
|
---|
13 | if (hasOwn) return true;
|
---|
14 | var parent = getPrototypeOf(O);
|
---|
15 | return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
|
---|
16 | };
|
---|
17 |
|
---|
18 | // `Reflect.hasMetadata` method
|
---|
19 | // https://github.com/rbuckton/reflect-metadata
|
---|
20 | $({ target: 'Reflect', stat: true }, {
|
---|
21 | hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {
|
---|
22 | var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]);
|
---|
23 | return ordinaryHasMetadata(metadataKey, anObject(target), targetKey);
|
---|
24 | }
|
---|
25 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.