mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
Rename cli/js2 to cli/rt (#6857)
This commit is contained in:
parent
090455936c
commit
ca4dcb36dd
63 changed files with 6 additions and 6 deletions
23
cli/rt/11_resources.js
Normal file
23
cli/rt/11_resources.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
((window) => {
|
||||
const sendSync = window.__bootstrap.dispatchJson.sendSync;
|
||||
|
||||
function resources() {
|
||||
const res = sendSync("op_resources");
|
||||
const resources = {};
|
||||
for (const resourceTuple of res) {
|
||||
resources[resourceTuple[0]] = resourceTuple[1];
|
||||
}
|
||||
return resources;
|
||||
}
|
||||
|
||||
function close(rid) {
|
||||
sendSync("op_close", { rid });
|
||||
}
|
||||
|
||||
window.__bootstrap.resources = {
|
||||
close,
|
||||
resources,
|
||||
};
|
||||
})(this);
|
Loading…
Add table
Add a link
Reference in a new issue