8000 fix: fix checking Reflect existance (#284) · vuejs/vue-class-component@e80a44b · GitHub
[go: up one dir, main page]

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 3 deletions
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)
0