File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,7 @@ import {
3636 legacyresolveScopedSlots ,
3737} from './renderHelpers'
3838import { resolveFilter } from '../helpers/resolveAssets'
39- import type { InternalSlots , Slots } from '../componentSlots'
40- import type { ContextualRenderFn } from '../componentRenderContext'
39+ import type { Slots } from '../componentSlots'
4140import { resolveMergedOptions } from '../componentOptions'
4241
4342export type LegacyPublicInstance = ComponentPublicInstance &
@@ -106,14 +105,7 @@ export function installCompatInstanceProperties(map: PublicPropertiesMap) {
106105
107106 $scopedSlots : i => {
108107 assertCompatEnabled ( DeprecationTypes . INSTANCE_SCOPED_SLOTS , i )
109- const res : InternalSlots = { }
110- for ( const key in i . slots ) {
111- const fn = i . slots [ key ] !
112- if ( ! ( fn as ContextualRenderFn ) . _ns /* non-scoped slot */ ) {
113- res [ key ] = fn
114- }
115- }
116- return res
108+ return __DEV__ ? shallowReadonly ( i . slots ) : i . slots
117109 } ,
118110
119111 $on : i => on . bind ( null , i ) ,
Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ describe('INSTANCE_SCOPED_SLOTS', () => {
284284 ) . toHaveBeenWarned ( )
285285 } )
286286
287- test ( 'should not include legacy slot usage in $scopedSlots' , ( ) => {
287+ test ( 'should include legacy slot usage in $scopedSlots' , ( ) => {
288288 let normalSlots : Slots
289289 let scopedSlots : Slots
290290 new Vue ( {
@@ -301,7 +301,7 @@ describe('INSTANCE_SCOPED_SLOTS', () => {
301301 } ) . $mount ( )
302302
303303 expect ( 'default' in normalSlots ! ) . toBe ( true )
304- expect ( 'default' in scopedSlots ! ) . toBe ( false )
304+ expect ( 'default' in scopedSlots ! ) . toBe ( true )
305305
306306 expect (
307307 deprecationData [ DeprecationTypes . INSTANCE_SCOPED_SLOTS ] . message ,
You can’t perform that action at this time.
0 commit comments