import type * as d from '../../declarations' ; import { BUILD } from '@app-data' ; import { EMPTY_OBJ } from '@utils' ; import { NODE_TYPE } from '../runtime-constants' ; import { setAccessor } from './set-accessor' ; export const updateElement = ( oldVnode , newVnode , isSvgMode , memberName ? ) : void => { const elm = newVnode . $elm$ . nodeType === NODE_TYPE . DocumentFragment && newVnode . $elm$ . host ? newVnode . $elm$ . host : ( newVnode . $elm$ as any ) ; const oldVnodeAttrs = ( oldVnode && oldVnode . $attrs$ ) || EMPTY_OBJ ; const newVnodeAttrs = newVnode . $attrs$ || EMPTY_OBJ ; if ( BUILD . updatable ) { for ( memberName in oldVnodeAttrs ) { if ( ! ( memberName in newVnodeAttrs ) ) { setAccessor ( elm , memberName , oldVnodeAttrs [ memberName ] , undefined , isSvgMode , newVnode . $flags$ ) ; } } } for ( memberName in newVnodeAttrs ) { setAccessor ( elm , memberName , oldVnodeAttrs [ memberName ] , newVnodeAttrs [ memberName ] , isSvgMode , newVnode . $flags$ ) ; } } ;