File tree Expand file tree Collapse file tree 2 files changed +0
-15
lines changed Expand file tree Collapse file tree 2 files changed +0
-15
lines changed Original file line number Diff line number Diff line change @@ -386,16 +386,6 @@ describe('reactivity/ref', () => {
386386 expect ( dummyY ) . toBe ( 5 )
387387 } )
388388
389- test ( 'toRefs should warn on plain object' , ( ) => {
390- toRefs ( { } )
391- expect ( `toRefs() expects a reactive object` ) . toHaveBeenWarned ( )
392- } )
393-
394- test ( 'toRefs should warn on plain array' , ( ) => {
395- toRefs ( [ ] )
396- expect ( `toRefs() expects a reactive object` ) . toHaveBeenWarned ( )
397- } )
398-
399389 test ( 'toRefs reactive array' , ( ) => {
400390 const arr = reactive ( [ 'a' , 'b' , 'c' ] )
401391 const refs = toRefs ( arr )
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { Dep, getDepFromReactive } from './dep'
99import {
1010 type Builtin ,
1111 type ShallowReactiveMarker ,
12- isProxy ,
1312 isReactive ,
1413 isReadonly ,
1514 isShallow ,
@@ -18,7 +17,6 @@ import {
1817} from './reactive'
1918import type { ComputedRef , WritableComputedRef } from './computed'
2019import { ReactiveFlags , TrackOpTypes , TriggerOpTypes } from './constants'
21- import { warn } from './warning'
2220
2321declare const RefSymbol : unique symbol
2422export declare const RawSymbol : unique symbol
@@ -337,9 +335,6 @@ export type ToRefs<T = any> = {
337335 * @see {@link https://vuejs.org/api/reactivity-utilities.html#torefs }
338336 */
339337export function toRefs < T extends object > ( object : T ) : ToRefs < T > {
340- if ( __DEV__ && ! isProxy ( object ) ) {
341- warn ( `toRefs() expects a reactive object but received a plain one.` )
342- }
343338 const ret : any = isArray ( object ) ? new Array ( object . length ) : { }
344339 for ( const key in object ) {
345340 ret [ key ] = propertyToRef ( object , key )
You can’t perform that action at this time.
0 commit comments