summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2021-07-11 18:12:26 -0700
committerGitHub <noreply@github.com>2021-07-11 18:12:26 -0700
commit511c48a03adee54aaadbefdeb2d2d521f6a45843 (patch)
tree817acc25f4c598fdc985f306f29fb3c318f87c55 /runtime/js
parenteea6000ef6e30e6684995619e630d3beb7d7484b (diff)
Revert "Remove unstable native plugins (#10908)"
This reverts commit 7dd4090c2a3dc0222fd6ff611eeb2bd69cd28224.
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/40_plugins.js16
-rw-r--r--runtime/js/90_deno_ns.js1
2 files changed, 17 insertions, 0 deletions
diff --git a/runtime/js/40_plugins.js b/runtime/js/40_plugins.js
new file mode 100644
index 000000000..0796fd5ce
--- /dev/null
+++ b/runtime/js/40_plugins.js
@@ -0,0 +1,16 @@
+// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
+
+((window) => {
+ const core = window.Deno.core;
+
+ function openPlugin(filename) {
+ const rid = core.opSync("op_open_plugin", filename);
+ core.syncOpsCache();
+ return rid;
+ }
+
+ window.__bootstrap.plugins = {
+ openPlugin,
+ };
+})(this);
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js
index 89c9ef060..e4d0b00f2 100644
--- a/runtime/js/90_deno_ns.js
+++ b/runtime/js/90_deno_ns.js
@@ -109,6 +109,7 @@
Signal: __bootstrap.signals.Signal,
SignalStream: __bootstrap.signals.SignalStream,
emit: __bootstrap.compilerApi.emit,
+ openPlugin: __bootstrap.plugins.openPlugin,
kill: __bootstrap.process.kill,
setRaw: __bootstrap.tty.setRaw,
consoleSize: __bootstrap.tty.consoleSize,