"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/v3/reactivity/reactive.ts" between
vue-2.7.13.tar.gz and vue-2.7.14.tar.gz

About: Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

reactive.ts  (vue-2.7.13):reactive.ts  (vue-2.7.14)
import { observe, Observer } from 'core/observer' import { observe, Observer } from 'core/observer'
import { import {
def, def,
isArray, isArray,
isPrimitive, isPrimitive,
warn, warn,
toRawType, toRawType,
isServerRendering, isServerRendering
isObject
} from 'core/util' } from 'core/util'
import type { Ref, UnwrapRefSimple, RawSymbol } from './ref' import type { Ref, UnwrapRefSimple, RawSymbol } from './ref'
export const rawMap = new WeakMap()
export const enum ReactiveFlags { export const enum ReactiveFlags {
SKIP = '__v_skip', SKIP = '__v_skip',
IS_READONLY = '__v_isReadonly', IS_READONLY = '__v_isReadonly',
IS_SHALLOW = '__v_isShallow', IS_SHALLOW = '__v_isShallow',
RAW = '__v_raw' RAW = '__v_raw'
} }
export interface Target { export interface Target {
__ob__?: Observer __ob__?: Observer
[ReactiveFlags.SKIP]?: boolean [ReactiveFlags.SKIP]?: boolean
skipping to change at line 125 skipping to change at line 122
} }
export function toRaw<T>(observed: T): T { export function toRaw<T>(observed: T): T {
const raw = observed && (observed as Target)[ReactiveFlags.RAW] const raw = observed && (observed as Target)[ReactiveFlags.RAW]
return raw ? toRaw(raw) : observed return raw ? toRaw(raw) : observed
} }
export function markRaw<T extends object>( export function markRaw<T extends object>(
value: T value: T
): T & { [RawSymbol]?: true } { ): T & { [RawSymbol]?: true } {
if (isObject(value)) { // non-extensible objects won't be observed anyway
rawMap.set(value, true) if (Object.isExtensible(value)) {
def(value, ReactiveFlags.SKIP, true)
} }
return value return value
} }
/** /**
* @internal * @internal
*/ */
export function isCollectionType(value: unknown): boolean { export function isCollectionType(value: unknown): boolean {
const type = toRawType(value) const type = toRawType(value)
return ( return (
 End of changes. 3 change blocks. 
6 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)