From: 龙腾道 Date: Mon, 19 Oct 2020 21:11:28 +0000 (+0800) Subject: fix(runtime-core): avoid object prototype keys in property access cache (#2416) X-Git-Tag: v3.0.2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba881f9190510c613f04950b69d78f6af1a90e06;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-core): avoid object prototype keys in property access cache (#2416) --- diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index 19035961c9..3fea92ba4e 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -549,7 +549,7 @@ function setupStatefulComponent( } } // 0. create render proxy property access cache - instance.accessCache = {} + instance.accessCache = Object.create(null) // 1. create public instance / render proxy // also mark it raw so it's never observed instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers)