TypeScript/tests/baselines/reference/importMetaNarrowing(module=system).js
Eli Barzilay d495957065 Add missing MetaProperty stuffs
Add missing parts in the binder and the checker to enable CFA +
narrowing of `import.meta` values.

Fixes #41468
2021-02-22 19:33:01 -05:00

23 lines
498 B
TypeScript

//// [importMetaNarrowing.ts]
declare global { interface ImportMeta {foo?: () => void} };
if (import.meta.foo) {
import.meta.foo();
}
//// [importMetaNarrowing.js]
System.register([], function (exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
return {
setters: [],
execute: function () {
;
if (context_1.meta.foo) {
context_1.meta.foo();
}
}
};
});