} from './reactiveEffect'
import { ReactiveFlags, TrackOpTypes, TriggerOpTypes } from './constants'
import { capitalize, hasChanged, hasOwn, isMap, toRawType } from '@vue/shared'
+import { warn } from './warning'
type CollectionTypes = IterableCollections | WeakCollections
return function (this: CollectionTypes, ...args: unknown[]) {
if (__DEV__) {
const key = args[0] ? `on key "${args[0]}" ` : ``
- console.warn(
+ warn(
`${capitalize(type)} operation ${key}failed: target is readonly.`,
toRaw(this),
)
const rawKey = toRaw(key)
if (rawKey !== key && has.call(target, rawKey)) {
const type = toRawType(target)
- console.warn(
+ warn(
`Reactive ${type} contains both the raw and reactive ` +
`versions of the same object${type === `Map` ? ` as keys` : ``}, ` +
`which can lead to inconsistencies. ` +
} from './collectionHandlers'
import type { RawSymbol, Ref, UnwrapRefSimple } from './ref'
import { ReactiveFlags } from './constants'
+import { warn } from './warning'
export interface Target {
[ReactiveFlags.SKIP]?: boolean
) {
if (!isObject(target)) {
if (__DEV__) {
- console.warn(`value cannot be made reactive: ${String(target)}`)
+ warn(`value cannot be made reactive: ${String(target)}`)
}
return target
}
import { type Dep, createDep } from './dep'
import { ComputedRefImpl } from './computed'
import { getDepFromReactive } from './reactiveEffect'
+import { warn } from './warning'
declare const RefSymbol: unique symbol
export declare const RawSymbol: unique symbol
*/
export function toRefs<T extends object>(object: T): ToRefs<T> {
if (__DEV__ && !isProxy(object)) {
- console.warn(`toRefs() expects a reactive object but received a plain one.`)
+ warn(`toRefs() expects a reactive object but received a plain one.`)
}
const ret: any = isArray(object) ? new Array(object.length) : {}
for (const key in object) {