function f(arg) {
if (!arg) {
arg = document.createElement("div");
}
arg.scrollIntoView();
}
is currently rewritten to
import { createElement as Document_createElement } from "std:global/Document";
import { apply as Reflect_apply } from "std:global/Reflect";
import { document_get as Window_document_get } from "std:global/Window";
function f(arg) {
if (!arg) {
arg = Reflect_apply(Document_createElement, Window_document_get(), ["div"]);
}
arg.scrollIntoView();
}
I think ts-morph gives us enough info to know that arg is HTMLDivElement|Any and so we should either be conservative and rewrite it to be assume the worse case (HTMLDivElement) or refuse to rewrite it.
is currently rewritten to
I think ts-morph gives us enough info to know that
arg
isHTMLDivElement|Any
and so we should either be conservative and rewrite it to be assume the worse case (HTMLDivElement
) or refuse to rewrite it.