Skip to content

Commit 8edddee

Browse files
fix: adds check for Reflect. Reflect.getOwnMetadataKeys
1 parent 7ecde38 commit 8edddee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/reflect.ts

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

4-
export const reflectionIsSupported = typeof Reflect !== 'undefined' && Reflect.defineMetadata
4+
// The rational behind the verbose Reflect-feature check below is the fact that there are Reflect-polyfills
5+
// this add and implementation for Reflect.defineMetadata but not Reflect.getOwnMetadataKeys. Without this
6+
// check consumers will encounter runtime errors.
7+
export const reflectionIsSupported = typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys
58

69
export function copyReflectionMetadata (
710
to: VueConstructor,

0 commit comments

Comments
 (0)