Skip to content

Commit e80a44b

Browse files
authored
fix: fix checking Reflect existance (#284)
1 parent dfd45be commit e80a44b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function componentFactory (
8282

8383
forwardStaticMembers(Extended, Component, Super)
8484

85-
if (reflectionIsSupported()) {
85+
if (reflectionIsSupported) {
8686
copyReflectionMetadata(Extended, Component)
8787
}
8888

src/reflect.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import Vue, { VueConstructor } from 'vue'
22
import { VueClass } from './declarations'
33

4-
export function reflectionIsSupported () {
5-
return (Reflect && Reflect.defineMetadata) !== undefined
6-
}
4+
export const reflectionIsSupported = typeof Reflect !== undefined && Reflect.defineMetadata
75

86
export function copyReflectionMetadata (
97
to: VueConstructor,

0 commit comments

Comments
 (0)