deno/cli/tests/if_main.ts
Bartek Iwańczuk 6661e7e287
BREAKING: remove window.location and self.location (#5034)
This commit removes "location" global available on "window",
"globalThis" and "self".
2020-05-01 20:15:28 +02:00

7 lines
136 B
TypeScript

if (import.meta.main) {
console.log("main");
} else {
console.log("import.meta.url", import.meta.url);
throw Error("not main");
}