@@ -8,21 +8,19 @@ const has_browser_globals = typeof window !== 'undefined';
88// than megamorphic.
99const node_prototype = /** @type {Node } */ ( has_browser_globals ? Node . prototype : { } ) ;
1010const element_prototype = /** @type {Element } */ ( has_browser_globals ? Element . prototype : { } ) ;
11- const event_target_prototype = /** @type {EventTarget } */ (
12- has_browser_globals ? EventTarget . prototype : { }
13- ) ;
11+ const text_prototype = /** @type {Text } */ ( has_browser_globals ? Text . prototype : { } ) ;
1412const map_prototype = Map . prototype ;
1513const append_child_method = node_prototype . appendChild ;
1614const clone_node_method = node_prototype . cloneNode ;
1715const map_set_method = map_prototype . set ;
1816const map_get_method = map_prototype . get ;
1917const map_delete_method = map_prototype . delete ;
20- // @ts -expect-error improve perf of expando on DOM nodes for events
21- event_target_prototype . __click = undefined ;
22- // @ts -expect-error improve perf of expando on DOM textValue updates
23- event_target_prototype . __nodeValue = ' ' ;
18+ // @ts -expect-error improve perf of expando on DOM events
19+ element_prototype . __click = undefined ;
20+ // @ts -expect-error improve perf of expando on DOM text updates
21+ text_prototype . __nodeValue = ' ' ;
2422// @ts -expect-error improve perf of expando on DOM className updates
25- event_target_prototype . __className = '' ;
23+ element_prototype . __className = '' ;
2624
2725const first_child_get = /** @type {(this: Node) => ChildNode | null } */ (
2826 // @ts -ignore
@@ -162,11 +160,10 @@ export function set_class_name(node, class_name) {
162160/**
163161 * @template {Node} N
164162 * @param {N } node
165- * @param {string } text
166163 * @returns {void }
167164 */
168- export function text_content ( node , text ) {
169- text_content_set . call ( node , text ) ;
165+ export function clear_text_content ( node ) {
166+ text_content_set . call ( node , '' ) ;
170167}
171168
172169/** @param {string } name */
0 commit comments