chore: remove map_set and map_get

pull/12219/head
Dominic Gannaway 4 months ago
parent c42bb04276
commit 5663ed12fc

@ -1,6 +1,6 @@
import { DEV } from 'esm-env';
import { hydrating } from '../hydration.js';
import { get_descriptors, get_prototype_of, map_get, map_set } from '../../utils.js';
import { get_descriptors, get_prototype_of } from '../../utils.js';
import {
AttributeAliases,
DelegatedEvents,
@ -166,8 +166,8 @@ export function set_attributes(element, prev, next, lowercase_attributes, css_ha
next.class = '';
}
var setters = map_get(setters_cache, element.nodeName);
if (!setters) map_set(setters_cache, element.nodeName, (setters = get_setters(element)));
var setters = setters_cache.get(element.nodeName);
if (!setters) setters_cache.set(element.nodeName, (setters = get_setters(element)));
// @ts-expect-error
var attributes = /** @type {Record<string, unknown>} **/ (element.__attributes ??= {});

@ -13,33 +13,6 @@ export var object_prototype = Object.prototype;
export var array_prototype = Array.prototype;
export var get_prototype_of = Object.getPrototypeOf;
/** @type {Map<any, any>} */
var map_prototype = Map.prototype;
var map_set_method = map_prototype.set;
var map_get_method = map_prototype.get;
/**
* @template K
* @template V
* @param {Map<K, V>} map
* @param {K} key
* @param {V} value
*/
export function map_set(map, key, value) {
map_set_method.call(map, key, value);
}
/**
* @template K
* @template V
* @param {Map<K, V>} map
* @param {K} key
* @return {V}
*/
export function map_get(map, key) {
return map_get_method.call(map, key);
}
/**
* @param {any} thing
* @returns {thing is Function}

Loading…
Cancel
Save