summaryrefslogtreecommitdiff
path: root/js/os.ts
diff options
context:
space:
mode:
authorKevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>2019-04-19 17:39:54 -0700
committerRyan Dahl <ry@tinyclouds.org>2019-04-19 20:39:54 -0400
commitc8db224efed08d7722c9951cde048d731db050d3 (patch)
treeb492275744af8dfae9977ef8309925e725daba09 /js/os.ts
parent0796a8f2f75005df95ef6115a4bdf6dd66e58dc3 (diff)
Make Deno/Deno.core not deletable/writable (#2153)
Diffstat (limited to 'js/os.ts')
-rw-r--r--js/os.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/js/os.ts b/js/os.ts
index 86a2c4943..5dc5521b4 100644
--- a/js/os.ts
+++ b/js/os.ts
@@ -6,6 +6,7 @@ import * as flatbuffers from "./flatbuffers";
import { TextDecoder } from "./text_encoding";
import { assert } from "./util";
import * as util from "./util";
+import { window } from "./window";
/** The current process id of the runtime. */
export let pid: number;
@@ -168,5 +169,9 @@ export function start(source?: string): msg.StartRes {
setGlobals(startResMsg.pid(), startResMsg.noColor(), startResMsg.execPath()!);
+ // Deno.core could ONLY be safely frozen here (not in globals.ts)
+ // since shared_queue.js will modify core properties.
+ Object.freeze(window.Deno.core);
+
return startResMsg;
}