1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-23 15:16:54 -05:00
denoland-deno/cli/rt/11_resources.js

24 lines
498 B
JavaScript
Raw Normal View History

// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
((window) => {
const core = window.Deno.core;
function resources() {
const res = core.jsonOpSync("op_resources");
const resources = {};
for (const resourceTuple of res) {
resources[resourceTuple[0]] = resourceTuple[1];
}
return resources;
}
function close(rid) {
core.jsonOpSync("op_close", { rid });
}
window.__bootstrap.resources = {
close,
resources,
};
})(this);