Revert "Remove unstable native plugins (#10908)"

This reverts commit 7dd4090c2a.
This commit is contained in:
Ryan Dahl 2021-07-11 18:12:26 -07:00 committed by GitHub
parent eea6000ef6
commit 511c48a03a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 487 additions and 4 deletions

16
runtime/js/40_plugins.js Normal file
View file

@ -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);

View file

@ -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,