|
@@ -55,7 +55,7 @@ import { convertLegacyVModelProps } from './compat/componentVModel'
|
|
|
import { defineLegacyVNodeProperties } from './compat/renderFn'
|
|
import { defineLegacyVNodeProperties } from './compat/renderFn'
|
|
|
import { ErrorCodes, callWithAsyncErrorHandling } from './errorHandling'
|
|
import { ErrorCodes, callWithAsyncErrorHandling } from './errorHandling'
|
|
|
import type { ComponentPublicInstance } from './componentPublicInstance'
|
|
import type { ComponentPublicInstance } from './componentPublicInstance'
|
|
|
-import { attrsProto } from './componentProps'
|
|
|
|
|
|
|
+import { isInternalObject } from './internalObject'
|
|
|
|
|
|
|
|
export const Fragment = Symbol.for('v-fgt') as any as {
|
|
export const Fragment = Symbol.for('v-fgt') as any as {
|
|
|
__isFragment: true
|
|
__isFragment: true
|
|
@@ -617,9 +617,7 @@ function _createVNode(
|
|
|
|
|
|
|
|
export function guardReactiveProps(props: (Data & VNodeProps) | null) {
|
|
export function guardReactiveProps(props: (Data & VNodeProps) | null) {
|
|
|
if (!props) return null
|
|
if (!props) return null
|
|
|
- return isProxy(props) || Object.getPrototypeOf(props) === attrsProto
|
|
|
|
|
- ? extend({}, props)
|
|
|
|
|
- : props
|
|
|
|
|
|
|
+ return isProxy(props) || isInternalObject(props) ? extend({}, props) : props
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export function cloneVNode<T, U>(
|
|
export function cloneVNode<T, U>(
|
|
@@ -791,7 +789,7 @@ export function normalizeChildren(vnode: VNode, children: unknown) {
|
|
|
} else {
|
|
} else {
|
|
|
type = ShapeFlags.SLOTS_CHILDREN
|
|
type = ShapeFlags.SLOTS_CHILDREN
|
|
|
const slotFlag = (children as RawSlots)._
|
|
const slotFlag = (children as RawSlots)._
|
|
|
- if (!slotFlag) {
|
|
|
|
|
|
|
+ if (!slotFlag && !isInternalObject(children)) {
|
|
|
// if slots are not normalized, attach context instance
|
|
// if slots are not normalized, attach context instance
|
|
|
// (compiled / normalized slots already have context)
|
|
// (compiled / normalized slots already have context)
|
|
|
;(children as RawSlots)._ctx = currentRenderingInstance
|
|
;(children as RawSlots)._ctx = currentRenderingInstance
|