Add missing parts in the binder and the checker to enable CFA + narrowing of `import.meta` values. Fixes #41468
20 lines
473 B
Plaintext
20 lines
473 B
Plaintext
=== tests/cases/conformance/es2019/importMeta/importMetaNarrowing.ts ===
|
|
declare global { interface ImportMeta {foo?: () => void} };
|
|
>global : any
|
|
>foo : (() => void) | undefined
|
|
|
|
if (import.meta.foo) {
|
|
>import.meta.foo : (() => void) | undefined
|
|
>import.meta : ImportMeta
|
|
>meta : any
|
|
>foo : (() => void) | undefined
|
|
|
|
import.meta.foo();
|
|
>import.meta.foo() : void
|
|
>import.meta.foo : () => void
|
|
>import.meta : ImportMeta
|
|
>meta : any
|
|
>foo : () => void
|
|
}
|
|
|