Skip to content

Commit

Permalink
m.domFor(): workaround for unintentional mangling. Fix #2842 (#2981)
Browse files Browse the repository at this point in the history
  • Loading branch information
kfule authored Sep 30, 2024
1 parent e15602b commit b5857a7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions render/domFor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

var delayedRemoval = new WeakMap

function *domFor({dom, domSize}, {generation} = {}) {
function *domFor(vnode, object = {}) {
// To avoid unintended mangling of the internal bundler,
// parameter destructuring is not used here.
var dom = vnode.dom
var domSize = vnode.domSize
var generation = object.generation
if (dom != null) do {
const {nextSibling} = dom
var nextSibling = dom.nextSibling

if (delayedRemoval.get(dom) === generation) {
yield dom
Expand All @@ -19,4 +24,4 @@ function *domFor({dom, domSize}, {generation} = {}) {
module.exports = {
delayedRemoval: delayedRemoval,
domFor: domFor,
}
}

0 comments on commit b5857a7

Please sign in to comment.