Skip to content

Commit a4098d5

Browse files
authored
chore(reactivity): consistent variable naming (#10350)
1 parent e2d3235 commit a4098d5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/reactivity/src/baseHandlers.ts

+11-11
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

@@ -164,8 +164,8 @@ class BaseReactiveHandler implements ProxyHandler<Target> {
164164
}
165165

166166
class MutableReactiveHandler extends BaseReactiveHandler {
167-
constructor(shallow = false) {
168-
super(false, shallow)
167+
constructor(isShallow = false) {
168+
super(false, isShallow)
169169
}
170170

171171
set(
@@ -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)
@@ -237,8 +237,8 @@ class MutableReactiveHandler extends BaseReactiveHandler {
237237
}
238238

239239
class ReadonlyReactiveHandler extends BaseReactiveHandler {
240-
constructor(shallow = false) {
241-
super(true, shallow)
240+
constructor(isShallow = false) {
241+
super(true, isShallow)
242242
}
243243

244244
set(target: object, key: string | symbol) {

0 commit comments

Comments
 (0)