aboutsummaryrefslogtreecommitdiff
path: root/lib/styles/html-paths.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-08-28 17:30:31 +0100
committerMichael Williamson <mike@zwobble.org>2026-08-28 17:30:31 +0100
commit2888fa158d67c1419199f152326e12a05618b53e (patch)
treec239ed44678ba87f29ff9b84625cf1a0ba48a68a /lib/styles/html-paths.js
parent31f0c370be4b95ac4fa285fea3be970606735f16 (diff)
Create objects without prototypes when used as map with arbitrary keys
Diffstat (limited to 'lib/styles/html-paths.js')
-rw-r--r--lib/styles/html-paths.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/styles/html-paths.js b/lib/styles/html-paths.js
index 27bb777..757133f 100644
--- a/lib/styles/html-paths.js
+++ b/lib/styles/html-paths.js
@@ -38,7 +38,7 @@ function element(tagName, attributes, options) {
}
function Element(tagName, attributes, options) {
- var tagNames = {};
+ var tagNames = Object.create(null);
if (_.isArray(tagName)) {
tagName.forEach(function(tagName) {
tagNames[tagName] = true;
@@ -47,7 +47,7 @@ function Element(tagName, attributes, options) {
} else {
tagNames[tagName] = true;
}
-
+
this.tagName = tagName;
this.tagNames = tagNames;
this.attributes = attributes || {};