From bc082f777593d6c6eb1b1053e46a441fa835d720 Mon Sep 17 00:00:00 2001 From: kfule Date: Sat, 28 Sep 2024 00:07:18 +0900 Subject: [PATCH 1/3] m.domFor(): workaround for unintentional mangling. Fix #2842 --- render/domFor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/render/domFor.js b/render/domFor.js index 705a510b0..f6c7e0bf4 100644 --- a/render/domFor.js +++ b/render/domFor.js @@ -2,7 +2,10 @@ var delayedRemoval = new WeakMap -function *domFor({dom, domSize}, {generation} = {}) { +function *domFor(vnode, object = {}) { + var dom = vnode.dom + var domSize = vnode.domSize + var generation = object.generation if (dom != null) do { const {nextSibling} = dom From 677717918775bb8aa2061ea03e57e4f57158e63e Mon Sep 17 00:00:00 2001 From: kfule Date: Sat, 28 Sep 2024 07:55:14 +0900 Subject: [PATCH 2/3] add comment why parameter destructuring is not used --- render/domFor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/render/domFor.js b/render/domFor.js index f6c7e0bf4..aed2921d2 100644 --- a/render/domFor.js +++ b/render/domFor.js @@ -3,6 +3,8 @@ var delayedRemoval = new WeakMap 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 @@ -22,4 +24,4 @@ function *domFor(vnode, object = {}) { module.exports = { delayedRemoval: delayedRemoval, domFor: domFor, -} \ No newline at end of file +} From 54475f7be8367149a8bf859f34d69dbf2b0f0066 Mon Sep 17 00:00:00 2001 From: kfule Date: Sun, 29 Sep 2024 20:01:43 +0900 Subject: [PATCH 3/3] m.domFor(): avoid all destructuring --- render/domFor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render/domFor.js b/render/domFor.js index aed2921d2..16b17a972 100644 --- a/render/domFor.js +++ b/render/domFor.js @@ -9,7 +9,7 @@ function *domFor(vnode, object = {}) { 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