perf(reactivity): should not track __isVue
(#2940)
This commit is contained in:
parent
9dc816d634
commit
dd02cf37d5
@ -22,10 +22,13 @@ import {
|
|||||||
hasChanged,
|
hasChanged,
|
||||||
isArray,
|
isArray,
|
||||||
isIntegerKey,
|
isIntegerKey,
|
||||||
extend
|
extend,
|
||||||
|
makeMap
|
||||||
} from '@vue/shared'
|
} from '@vue/shared'
|
||||||
import { isRef } from './ref'
|
import { isRef } from './ref'
|
||||||
|
|
||||||
|
const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`)
|
||||||
|
|
||||||
const builtInSymbols = new Set(
|
const builtInSymbols = new Set(
|
||||||
Object.getOwnPropertyNames(Symbol)
|
Object.getOwnPropertyNames(Symbol)
|
||||||
.map(key => (Symbol as any)[key])
|
.map(key => (Symbol as any)[key])
|
||||||
@ -93,7 +96,7 @@ function createGetter(isReadonly = false, shallow = false) {
|
|||||||
if (
|
if (
|
||||||
isSymbol(key)
|
isSymbol(key)
|
||||||
? builtInSymbols.has(key as symbol)
|
? builtInSymbols.has(key as symbol)
|
||||||
: key === `__proto__` || key === `__v_isRef`
|
: isNonTrackableKeys(key)
|
||||||
) {
|
) {
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user