summaryrefslogtreecommitdiff
path: root/core/runtime/bindings.js
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-07-01 18:00:14 -0600
committerGitHub <noreply@github.com>2023-07-02 00:00:14 +0000
commite746b6d80654ba4e4e26370fe6e4f784ce841d92 (patch)
tree153ffad92a96126b9ab8e906dcdabf7648755931 /core/runtime/bindings.js
parentb9c0e7cd550ab14fa7da7e33ed87cbeeeb9785a0 (diff)
refactor(core): Extract deno_core (#19658)
`deno_core` is moving out! You'll find it at https://github.com/denoland/deno_core/ once this PR lands.
Diffstat (limited to 'core/runtime/bindings.js')
-rw-r--r--core/runtime/bindings.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/core/runtime/bindings.js b/core/runtime/bindings.js
deleted file mode 100644
index 21d27a2c3..000000000
--- a/core/runtime/bindings.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-if (!globalThis.Deno) {
- globalThis.Deno = {
- core: {
- ops: {},
- asyncOps: {},
- },
- };
-}
-
-Deno.__op__console = function (callConsole, console) {
- Deno.core.callConsole = callConsole;
- Deno.core.console = console;
-};
-
-Deno.__op__registerOp = function (isAsync, op, opName) {
- const core = Deno.core;
- if (isAsync) {
- if (core.ops[opName] !== undefined) {
- return;
- }
- core.asyncOps[opName] = op;
- const fn = function (...args) {
- if (this !== core.ops) {
- // deno-lint-ignore prefer-primordials
- throw new Error(
- "An async stub cannot be separated from Deno.core.ops. Use ???",
- );
- }
- return core.asyncStub(opName, args);
- };
- fn.name = opName;
- core.ops[opName] = fn;
- } else {
- core.ops[opName] = op;
- }
-};
-
-Deno.__op__unregisterOp = function (isAsync, opName) {
- if (isAsync) {
- delete Deno.core.asyncOps[opName];
- }
- delete Deno.core.ops[opName];
-};
-
-Deno.__op__cleanup = function () {
- delete Deno.__op__console;
- delete Deno.__op__registerOp;
- delete Deno.__op__unregisterOp;
- delete Deno.__op__cleanup;
-};