Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goog.dom.appendChild documentation lists incorrect type #1201

Open
rome-user opened this issue Jul 17, 2023 · 1 comment
Open

goog.dom.appendChild documentation lists incorrect type #1201

rome-user opened this issue Jul 17, 2023 · 1 comment

Comments

@rome-user
Copy link

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.

goog.dom.appendChild = function(parent, child) {
'use strict';
goog.asserts.assert(
parent != null && child != null,
'goog.dom.appendChild expects non-null arguments');
parent.appendChild(child);
};

@shicks
Copy link
Member

shicks commented Jul 17, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants