From d024dcce0e0f0e25d472177f0d1c5d8d3dd02f6e Mon Sep 17 00:00:00 2001 From: Myth <3389772+iMyth@users.noreply.github.com> Date: Mon, 25 Mar 2019 20:32:27 +0800 Subject: [PATCH] fix: browser compatibility issues (#319) * fix: browser compatibility issues * style: removed the quotes * fix: updated comment --- src/component.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/component.ts b/src/component.ts index ded5b29..6524e7c 100644 --- a/src/component.ts +++ b/src/component.ts @@ -109,6 +109,13 @@ const reservedPropertyNames = [ 'filter' ] +const shouldIgnore = { + prototype: true, + arguments: true, + callee: true, + caller: true +} + function forwardStaticMembers ( Extended: typeof Vue, Original: typeof Vue, @@ -116,8 +123,8 @@ function forwardStaticMembers ( ): void { // We have to use getOwnPropertyNames since Babel registers methods as non-enumerable Object.getOwnPropertyNames(Original).forEach(key => { - // `prototype` should not be overwritten - if (key === 'prototype') { + // Skip the properties that should not be overwritten + if (shouldIgnore[key]) { return }