Skip to content

Commit 7d5597d

Browse files
committed
comments
1 parent 58cbf77 commit 7d5597d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/directives/scope.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export const createScopedContext = (ctx: Context, data: object): Context => {
88
const mergedScope = Object.assign(Object.create(parentScope), data)
99
const proxy = new Proxy(mergedScope, {
1010
set(target, key, val, receiver) {
11+
// when setting a property that doesn't exist on current scope,
12+
// do not create it on the current scope and fallback to parent scope.
1113
if (receiver === reactiveProxy && !target.hasOwnProperty(key)) {
1214
return Reflect.set(parentScope, key, val)
1315
}

0 commit comments

Comments
 (0)