diff --git a/src/core/vdom/patch.js b/src/core/vdom/patch.js index 455698a6..f7baa787 100644 --- a/src/core/vdom/patch.js +++ b/src/core/vdom/patch.js @@ -82,7 +82,7 @@ export function createPatchFunction (backend) { } function createElm (vnode, insertedVnodeQueue, nested) { - let i, elm + let i const data = vnode.data vnode.isRootInsert = !nested if (isDef(data)) { @@ -113,7 +113,7 @@ export function createPatchFunction (backend) { ) } } - elm = vnode.elm = vnode.ns + vnode.elm = vnode.ns ? nodeOps.createElementNS(vnode.ns, tag) : nodeOps.createElement(tag) setScope(vnode) @@ -122,9 +122,9 @@ export function createPatchFunction (backend) { invokeCreateHooks(vnode, insertedVnodeQueue) } } else if (vnode.isComment) { - elm = vnode.elm = nodeOps.createComment(vnode.text) + vnode.elm = nodeOps.createComment(vnode.text) } else { - elm = vnode.elm = nodeOps.createTextNode(vnode.text) + vnode.elm = nodeOps.createTextNode(vnode.text) } return vnode.elm } diff --git a/test/unit/modules/vdom/patch/hydration.spec.js b/test/unit/modules/vdom/patch/hydration.spec.js index f028a990..b69a477a 100644 --- a/test/unit/modules/vdom/patch/hydration.spec.js +++ b/test/unit/modules/vdom/patch/hydration.spec.js @@ -131,7 +131,7 @@ describe('vdom patch: hydration', () => { dom.setAttribute('server-rendered', 'true') dom.innerHTML = '