Skip to content

Commit

Permalink
perf(reactivity): should not track __isVue (#2940)
Browse files Browse the repository at this point in the history
  • Loading branch information
HcySunYang authored Feb 3, 2021
1 parent 9dc816d commit dd02cf3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/reactivity/src/baseHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ import {
hasChanged,
isArray,
isIntegerKey,
extend
extend,
makeMap
} from '@vue/shared'
import { isRef } from './ref'

const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`)

const builtInSymbols = new Set(
Object.getOwnPropertyNames(Symbol)
.map(key => (Symbol as any)[key])
Expand Down Expand Up @@ -93,7 +96,7 @@ function createGetter(isReadonly = false, shallow = false) {
if (
isSymbol(key)
? builtInSymbols.has(key as symbol)
: key === `__proto__` || key === `__v_isRef`
: isNonTrackableKeys(key)
) {
return res
}
Expand Down

0 comments on commit dd02cf3

Please sign in to comment.