From 5d551bbbf9d7825e99b417eca5fec47daa3de49c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 24 Jun 2025 15:29:21 -0300 Subject: html: use Reflect.ownKeys in Attributes.add() optimization --- src/html.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/html.js b/src/html.js index 685b72ca..dd1d1960 100644 --- a/src/html.js +++ b/src/html.js @@ -1168,8 +1168,8 @@ export class Attributes { // Preserve existing merge semantics by funnelling each key through // the internal #addOneAttribute helper (handles class/style union, // unique merging, etc.) but avoid *per-object* validation overhead. - for (const [key, val] of Object.entries(obj)) { - this.#addOneAttribute(key, val); + for (const key of Reflect.ownKeys(obj)) { + this.#addOneAttribute(key, obj[key]); } // Match the original return style (list of results) so callers that -- cgit 1.3.0-6-gf8a5