diff --git a/src/reflect.ts b/src/reflect.ts index ad1d0c5..09f40e6 100644 --- a/src/reflect.ts +++ b/src/reflect.ts @@ -1,7 +1,10 @@ import Vue, { VueConstructor } from 'vue' import { VueClass } from './declarations' -export const reflectionIsSupported = typeof Reflect !== 'undefined' && Reflect.defineMetadata +// The rational behind the verbose Reflect-feature check below is the fact that there are polyfills +// which add an implementation for Reflect.defineMetadata but not for Reflect.getOwnMetadataKeys. +// Without this check consumers will encounter hard to track down runtime errors. +export const reflectionIsSupported = typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys export function copyReflectionMetadata ( to: VueConstructor,