Skip to content

Commit

Permalink
run assert first
Browse files Browse the repository at this point in the history
  • Loading branch information
Nefsen402 committed Apr 15, 2024
1 parent 8793dad commit 7303f48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const mapNode = aux => {
};

const nodeMounter = (elem, e, before, aux) => {
aux = mapNode(aux);

assert(e.parentElement == null,
"Cannot mount a dom node that has already been mounted elsewhere.");

aux = mapNode(aux);
elem?.insertBefore(e, before(getFirst));

return (val, newAux) => {
Expand Down

0 comments on commit 7303f48

Please sign in to comment.