diff --git a/packages/runtime-dom/__tests__/patchProps.spec.ts b/packages/runtime-dom/__tests__/patchProps.spec.ts index ce30f91162f..7c82c41d8b0 100644 --- a/packages/runtime-dom/__tests__/patchProps.spec.ts +++ b/packages/runtime-dom/__tests__/patchProps.spec.ts @@ -7,7 +7,7 @@ describe('runtime-dom: props patching', () => { patchProp(el, 'id', null, 'foo') expect(el.id).toBe('foo') patchProp(el, 'id', null, null) - expect(el.id).toBe('') + expect(el.id).toBe('null') }) test('value', () => { @@ -30,6 +30,16 @@ describe('runtime-dom: props patching', () => { expect(el.multiple).toBe(false) }) + // #1049 + test('object prop', () => { + const el = document.createElement('video') + const object = {} + const set = jest.fn() + Object.defineProperty(el, 'srcObject', { enumerable: true, set }) + patchProp(el, 'srcObject', null, object) + expect(set).toHaveBeenCalledWith(object) + }) + test('innerHTML unmount prev children', () => { const fn = jest.fn() const comp = { diff --git a/packages/runtime-dom/src/modules/props.ts b/packages/runtime-dom/src/modules/props.ts index 0b36578eb88..99eb51241cb 100644 --- a/packages/runtime-dom/src/modules/props.ts +++ b/packages/runtime-dom/src/modules/props.ts @@ -32,6 +32,6 @@ export function patchDOMProp( // e.g.