google / closure-library

Google's common JavaScript library
code.google.com/closure/library/
Apache License 2.0
4.88k stars 1.05k forks source link

`goog.dom.appendChild` documentation lists incorrect type #1201

Closed rome-user closed 2 months ago

rome-user commented 1 year ago

See the following page https://google.github.io/closure-library/api/goog.dom.html#appendChild

The parameters parent and child are both listed as Node | null. However, the implementation of the function tells a different story.

https://github.com/google/closure-library/blob/5918355a90382ab6d17e31ba7df8044d40f319f1/closure/goog/dom/dom.js#L1258-L1264

shicks commented 1 year ago

Strictly speaking, this is correct. In practice, we've found it impossible to fix all of these incorrect nullability issues because of the mountain of legacy code that depends on them.

shicks commented 2 months ago

This issue is being closed as a preparation step before archiving the repository. See the README for more detail.