feat: Add Deno.mainModule (#6180)

This commit is contained in:
John Gardner 2020-06-11 13:00:29 +10:00 committed by GitHub
parent a1b37f177b
commit ca5b5ba530
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 0 deletions

View file

@ -9,6 +9,7 @@
import * as denoNs from "./deno.ts";
import * as denoUnstableNs from "./deno_unstable.ts";
import { opMainModule } from "./ops/runtime.ts";
import { exit } from "./ops/os.ts";
import {
readOnly,
@ -106,6 +107,7 @@ export function bootstrapMainRuntime(): void {
if (unstableFlag) {
Object.defineProperties(globalThis, unstableMethods);
Object.defineProperties(globalThis, unstableProperties);
Object.defineProperty(denoNs, "mainModule", getterOnly(opMainModule));
Object.assign(denoNs, denoUnstableNs);
}