@@ -8,21 +8,19 @@ const has_browser_globals = typeof window !== 'undefined';
8
8
// than megamorphic.
9
9
const node_prototype = /** @type {Node } */ ( has_browser_globals ? Node . prototype : { } ) ;
10
10
const 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 : { } ) ;
14
12
const map_prototype = Map . prototype ;
15
13
const append_child_method = node_prototype . appendChild ;
16
14
const clone_node_method = node_prototype . cloneNode ;
17
15
const map_set_method = map_prototype . set ;
18
16
const map_get_method = map_prototype . get ;
19
17
const 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 = ' ' ;
24
22
// @ts -expect-error improve perf of expando on DOM className updates
25
- event_target_prototype . __className = '' ;
23
+ element_prototype . __className = '' ;
26
24
27
25
const first_child_get = /** @type {(this: Node) => ChildNode | null } */ (
28
26
// @ts -ignore
@@ -162,11 +160,10 @@ export function set_class_name(node, class_name) {
162
160
/**
163
161
* @template {Node} N
164
162
* @param {N } node
165
- * @param {string } text
166
163
* @returns {void }
167
164
*/
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 , '' ) ;
170
167
}
171
168
172
169
/** @param {string } name */
0 commit comments