Skip to content

Commit 4f920cb

Browse files
committed
chore(reactivity): consistent variable naming
1 parent 272ab9f commit 4f920cb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/reactivity/src/baseHandlers.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,26 +89,26 @@ function hasOwnProperty(this: object, key: string) {
8989
class BaseReactiveHandler implements ProxyHandler<Target> {
9090
constructor(
9191
protected readonly _isReadonly = false,
92-
protected readonly _shallow = false,
92+
protected readonly _isShallow = false,
9393
) {}
9494

9595
get(target: Target, key: string | symbol, receiver: object) {
9696
const isReadonly = this._isReadonly,
97-
shallow = this._shallow
97+
isShallow = this._isShallow
9898
if (key === ReactiveFlags.IS_REACTIVE) {
9999
return !isReadonly
100100
} else if (key === ReactiveFlags.IS_READONLY) {
101101
return isReadonly
102102
} else if (key === ReactiveFlags.IS_SHALLOW) {
103-
return shallow
103+
return isShallow
104104
} else if (key === ReactiveFlags.RAW) {
105105
if (
106106
receiver ===
107107
(isReadonly
108-
? shallow
108+
? isShallow
109109
? shallowReadonlyMap
110110
: readonlyMap
111-
: shallow
111+
: isShallow
112112
? shallowReactiveMap
113113
: reactiveMap
114114
).get(target) ||
@@ -143,7 +143,7 @@ class BaseReactiveHandler implements ProxyHandler<Target> {
143143
track(target, TrackOpTypes.GET, key)
144144
}
145145

146-
if (shallow) {
146+
if (isShallow) {
147147
return res
148148
}
149149

@@ -175,7 +175,7 @@ class MutableReactiveHandler extends BaseReactiveHandler {
175175
receiver: object,
176176
): boolean {
177177
let oldValue = (target as any)[key]
178-
if (!this._shallow) {
178+
if (!this._isShallow) {
179179
const isOldValueReadonly = isReadonly(oldValue)
180180
if (!isShallow(value) && !isReadonly(value)) {
181181
oldValue = toRaw(oldValue)

0 commit comments

Comments
 (0)