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 and dead-claudia committed Oct 1, 2024
1 parent 1534722 commit dd77cb1
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 dd77cb1

Please sign in to comment.