From 74c1c5a58533ced7513e07e8d818f7c424a8e571 Mon Sep 17 00:00:00 2001 From: Vitali Shapovalov Date: Sun, 14 Jul 2019 10:48:12 +0300 Subject: [PATCH 1/2] check reflectionIsSupported in decorator runtime --- src/component.ts | 2 +- src/reflect.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/component.ts b/src/component.ts index 6524e7c..54a8192 100644 --- a/src/component.ts +++ b/src/component.ts @@ -83,7 +83,7 @@ export function componentFactory ( forwardStaticMembers(Extended, Component, Super) - if (reflectionIsSupported) { + if (reflectionIsSupported()) { copyReflectionMetadata(Extended, Component) } diff --git a/src/reflect.ts b/src/reflect.ts index 09f40e6..7f279dd 100644 --- a/src/reflect.ts +++ b/src/reflect.ts @@ -4,7 +4,9 @@ import { VueClass } from './declarations' // 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 reflectionIsSupported () { + return typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys; +} export function copyReflectionMetadata ( to: VueConstructor, From 87a31095f5645cee3a5eb06c7cf6af9a4c7df554 Mon Sep 17 00:00:00 2001 From: Vitali Shapovalov Date: Sun, 14 Jul 2019 11:10:19 +0300 Subject: [PATCH 2/2] fix lint --- src/reflect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reflect.ts b/src/reflect.ts index 7f279dd..ab65dff 100644 --- a/src/reflect.ts +++ b/src/reflect.ts @@ -5,7 +5,7 @@ import { VueClass } from './declarations' // 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 function reflectionIsSupported () { - return typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys; + return typeof Reflect !== 'undefined' && Reflect.defineMetadata && Reflect.getOwnMetadataKeys } export function copyReflectionMetadata ( pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy