Skip to content

Commit 2fc6ab5

Browse files
vitalishapovalovktsn
authored andcommitted
fix: check reflectionIsSupported in decorator runtime (#350)
* check reflectionIsSupported in decorator runtime * fix lint
1 parent f25f35b commit 2fc6ab5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function componentFactory (
8383

8484
forwardStaticMembers(Extended, Component, Super)
8585

86-
if (reflectionIsSupported) {
86+
if (reflectionIsSupported()) {
8787
copyReflectionMetadata(Extended, Component)
8888
}
8989

src/reflect.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { VueClass } from './declarations'
44
// The rational behind the verbose Reflect-feature check below is the fact that there are polyfills
55
// which add an implementation for Reflect.defineMetadata but not for Reflect.getOwnMetadataKeys.
66
// Without this check consumers will encounter hard to track down runtime errors.
7-
export const reflectionIsSupported = typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys
7+
export function reflectionIsSupported () {
8+
return typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys
9+
}
810

911
export function copyReflectionMetadata (
1012
to: VueConstructor,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy