Skip to content

Commit 9c2de62

Browse files
authored
fix(runtime-core): ensure slot compiler marker writable (#10825)
close #10818
1 parent 47453f1 commit 9c2de62

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: packages/runtime-core/src/componentSlots.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export const initSlots = (
171171
if (type) {
172172
extend(slots, children as InternalSlots)
173173
// make compiler marker non-enumerable
174-
def(slots, '_', type)
174+
def(slots, '_', type, true)
175175
} else {
176176
normalizeObjectSlots(children as RawSlots, slots, instance)
177177
}

Diff for: packages/shared/src/general.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,16 @@ export const invokeArrayFns = (fns: Function[], arg?: any) => {
139139
}
140140
}
141141

142-
export const def = (obj: object, key: string | symbol, value: any) => {
142+
export const def = (
143+
obj: object,
144+
key: string | symbol,
145+
value: any,
146+
writable = false,
147+
) => {
143148
Object.defineProperty(obj, key, {
144149
configurable: true,
145150
enumerable: false,
151+
writable,
146152
value,
147153
})
148154
}

0 commit comments

Comments
 (0)