m.domFor(): workaround for unintentional mangling. Fix #2842 (#2981)

This commit is contained in:
kfule 2024-10-01 07:04:42 +09:00 committed by GitHub
parent e15602ba49
commit b5857a7cd0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,9 +2,14 @@
var delayedRemoval = new WeakMap 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 { if (dom != null) do {
const {nextSibling} = dom var nextSibling = dom.nextSibling
if (delayedRemoval.get(dom) === generation) { if (delayedRemoval.get(dom) === generation) {
yield dom yield dom
@ -19,4 +24,4 @@ function *domFor({dom, domSize}, {generation} = {}) {
module.exports = { module.exports = {
delayedRemoval: delayedRemoval, delayedRemoval: delayedRemoval,
domFor: domFor, domFor: domFor,
} }