From 264fc082f83b87593569dfd072364a94dd9bedd2 Mon Sep 17 00:00:00 2001 From: Christian Kienle Date: Tue, 22 Jan 2019 11:48:15 +0100 Subject: [PATCH] fix: adds check for Reflect. Reflect.getOwnMetadataKeys --- src/reflect.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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,