-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove nullish coalescing for
textContent
.
The default browser behavior when setting `.textContent` to `null` or `undefined` is to ultimately set the content to `''`†. This is quite different from the behavior of `createTextNode` though… by splitting the text node creation into multiple steps we can consistently leverage `.textContent` and remove the need to `?? ''`. † Note that the WHATWG spec only defines that behavior for `null`, but in practice all modern browsers seem to treat `undefined` similarly.
- Loading branch information
1 parent
b4b0c97
commit 6df5f71
Showing
2 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters