We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96fe21e commit 3c7521cCopy full SHA for 3c7521c
src/vhtml.js
@@ -9,7 +9,7 @@ let DOMAttributeNames = {
9
htmlFor: 'for'
10
};
11
12
-let sanitized = {};
+let sanitized = new WeakMap();
13
14
/** Hyperscript reviver that constructs a sanitized HTML string. */
15
export default function h(name, attrs) {
@@ -47,14 +47,14 @@ export default function h(name, attrs) {
47
for (let i=child.length; i--; ) stack.push(child[i]);
48
}
49
else {
50
- s += sanitized[child]===true ? child : esc(child);
+ s += sanitized.has(child) ? child : esc(child);
51
52
53
54
55
s += name ? `</${name}>` : '';
56
57
58
- sanitized[s] = true;
+ sanitized.set(s, true);
59
return s;
60
0 commit comments