Skip to content

Commit

Permalink
chore: update core deps
Browse files Browse the repository at this point in the history
Avoid circular referencing the `hasOwnProperty` method in reactive proxy.

> vuejs/core#2621 (comment)
> More precise tracking can be achieved by returning an instrumented
> version of `hasOwnProperty` on reactive objects, as implemented in
> vuejs/core@588bd44
  • Loading branch information
nick-lai committed Nov 3, 2023
1 parent ef18d25 commit 5678ea6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5678ea6

Please sign in to comment.