aboutsummaryrefslogtreecommitdiff
path: root/src/vdom.ffi.mjs
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2024-03-31 18:28:51 +0100
committerHayleigh Thompson <me@hayleigh.dev>2024-03-31 18:28:51 +0100
commit6d26cfbac1c8a5c1f4585e6fb7a8a18f0aa949d1 (patch)
treeecbb903f87e27574e3b3e35be034b58171bf07c0 /src/vdom.ffi.mjs
parent54227dfde95571b76e3ee6998631bcd58d223cc2 (diff)
downloadlustre-6d26cfbac1c8a5c1f4585e6fb7a8a18f0aa949d1.tar.gz
lustre-6d26cfbac1c8a5c1f4585e6fb7a8a18f0aa949d1.zip
:bug: Fixed a bug where invalid property names may be set on a node and cause a crash.
Diffstat (limited to 'src/vdom.ffi.mjs')
-rw-r--r--src/vdom.ffi.mjs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vdom.ffi.mjs b/src/vdom.ffi.mjs
index e77db89..2515eb4 100644
--- a/src/vdom.ffi.mjs
+++ b/src/vdom.ffi.mjs
@@ -268,7 +268,7 @@ function createElementNode({ prev, next, dispatch, stack }) {
// that all attributes should be set as properties too.
else {
el.setAttribute(name, value);
- el[name] = value;
+ if (name in el) el[name] = value;
// If we're morphing an element we remove this attribute's name from the set
// of attributes that were on the previous render so we don't remove it in
// the next step.