From 5678ea6b75d81b532949d7e0a97c7edb019e5a34 Mon Sep 17 00:00:00 2001 From: Nick Lai Date: Sat, 4 Nov 2023 06:45:24 +0800 Subject: [PATCH] chore: update core deps Avoid circular referencing the `hasOwnProperty` method in reactive proxy. > https://github.com/vuejs/core/pull/2621#issuecomment-1313354723 > More precise tracking can be achieved by returning an instrumented > version of `hasOwnProperty` on reactive objects, as implemented in > https://github.com/vuejs/core/commit/588bd44f036b79d7dee5d23661aa7244f70e6beb --- package.json | 4 ++-- pnpm-lock.yaml | 18 +++++++++--------- src/context.ts | 3 ++- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index eb51944..50536ac 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ }, "homepage": "https://github.com/vuejs/petite-vue#readme", "devDependencies": { - "@vue/reactivity": "^3.2.27", - "@vue/shared": "^3.2.27", + "@vue/reactivity": "^3.3.7", + "@vue/shared": "^3.3.7", "chalk": "^4.1.1", "conventional-changelog-cli": "^2.1.1", "enquirer": "^2.3.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fa5f4bb..5fa41a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,11 +6,11 @@ settings: devDependencies: '@vue/reactivity': - specifier: ^3.2.27 - version: 3.2.27 + specifier: ^3.3.7 + version: 3.3.7 '@vue/shared': - specifier: ^3.2.27 - version: 3.2.27 + specifier: ^3.3.7 + version: 3.3.7 chalk: specifier: ^4.1.1 version: 4.1.2 @@ -270,14 +270,14 @@ packages: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true - /@vue/reactivity@3.2.27: - resolution: {integrity: sha512-QPfIQEJidRGIu/mPexhcB4csp1LEg2Nr+/QE72MnXs/OYDtFErhC9FxIyymkxp/xvAgL5wsnSOuDD6zWF42vRQ==} + /@vue/reactivity@3.3.7: + resolution: {integrity: sha512-cZNVjWiw00708WqT0zRpyAgduG79dScKEPYJXq2xj/aMtk3SKvL3FBt2QKUlh6EHBJ1m8RhBY+ikBUzwc7/khg==} dependencies: - '@vue/shared': 3.2.27 + '@vue/shared': 3.3.7 dev: true - /@vue/shared@3.2.27: - resolution: {integrity: sha512-rpAn9k6O08Lvo7ekBIAnkOukX/4EsEQLPrRJBKhIEasMsOI5eX0f6mq1sDUSY7cgAqWw2d7QtP74CWxdXoyKxA==} + /@vue/shared@3.3.7: + resolution: {integrity: sha512-N/tbkINRUDExgcPTBvxNkvHGu504k8lzlNQRITVnm6YjOjwa4r0nnbd4Jb01sNpur5hAllyRJzSK5PvB9PPwRg==} dev: true /JSONStream@1.3.5: diff --git a/src/context.ts b/src/context.ts index 44df1af..caf2f61 100644 --- a/src/context.ts +++ b/src/context.ts @@ -3,6 +3,7 @@ import { reactive, ReactiveEffectRunner } from '@vue/reactivity' +import { hasOwn } from '@vue/shared' import { Block } from './block' import { Directive } from './directives' import { queueJob } from './scheduler' @@ -54,7 +55,7 @@ export const createScopedContext = (ctx: Context, data = {}): Context => { set(target, key, val, receiver) { // when setting a property that doesn't exist on current scope, // do not create it on the current scope and fallback to parent scope. - if (receiver === reactiveProxy && !target.hasOwnProperty(key)) { + if (receiver === reactiveProxy && !hasOwn(target, key)) { return Reflect.set(parentScope, key, val) } return Reflect.set(target, key, val, receiver)