Skip to content

Commit 4f3caca

Browse files
committed
fix: add more robust check for Element prototype
fixes #13691 fixes #13414 fixes #13726
1 parent 8a06d05 commit 4f3caca

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/gorgeous-vans-sparkle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: add more robust check for `Element` prototype

packages/svelte/src/internal/client/dom/elements/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ function get_setters(element) {
320320
var proto = get_prototype_of(element);
321321

322322
// Stop at Element, from there on there's only unnecessary setters we're not interested in
323-
while (proto.constructor.name !== 'Element') {
323+
// Do not use contructor.name here as that's unreliable in some browser environments
324+
while (!Element.prototype.isPrototypeOf(proto)) {
324325
descriptors = get_descriptors(proto);
325326

326327
for (var key in descriptors) {

0 commit comments

Comments
 (0)