Skip to content

Commit dd30558

Browse files
committed
side-effects agin
1 parent 25762b1 commit dd30558

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/svelte/src/utils.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,19 @@ const DOM_PROPERTIES = [
216216
'srcObject'
217217
];
218218

219-
const DOM_PROPERTIES_MAP = new Map(
220-
DOM_PROPERTIES.map((property) => [property.toLowerCase(), property])
221-
);
219+
/** @type {Map<string, string>} */
220+
let DOM_PROPERTIES_MAP;
222221

223222
/**
224223
* @param {string} name
225224
* @returns {string | undefined}
226225
*/
227226
export function get_dom_property(name) {
227+
if (!DOM_PROPERTIES_MAP) {
228+
DOM_PROPERTIES_MAP = new Map(
229+
DOM_PROPERTIES.map((property) => [property.toLowerCase(), property])
230+
);
231+
}
228232
return DOM_PROPERTIES_MAP.get(name);
229233
}
230234

0 commit comments

Comments
 (0)