chore(reactivity): use consistent naming for ReactiveFlags enum (#1428)

This commit is contained in:
edison
2020-06-26 21:32:09 +08:00
committed by GitHub
parent e765d81404
commit 178e89305d
4 changed files with 34 additions and 34 deletions

View File

@@ -42,16 +42,16 @@ const arrayInstrumentations: Record<string, Function> = {}
function createGetter(isReadonly = false, shallow = false) {
return function get(target: object, key: string | symbol, receiver: object) {
if (key === ReactiveFlags.isReactive) {
if (key === ReactiveFlags.IS_REACTIVE) {
return !isReadonly
} else if (key === ReactiveFlags.isReadonly) {
} else if (key === ReactiveFlags.IS_READONLY) {
return isReadonly
} else if (
key === ReactiveFlags.raw &&
key === ReactiveFlags.RAW &&
receiver ===
(isReadonly
? (target as any).__v_readonly
: (target as any).__v_reactive)
? (target as any)[ReactiveFlags.READONLY]
: (target as any)[ReactiveFlags.REACTIVE])
) {
return target
}