"use strict";
((window) => {
const core = Deno.core;
const webidl = window.__bootstrap.webidl;
const { _byteSequence } = window.__bootstrap.file;
const { URL } = window.__bootstrap.url;
function createObjectURL(blob) {
const prefix = "Failed to execute 'createObjectURL' on 'URL'";
webidl.requiredArguments(arguments.length, 1, { prefix });
blob = webidl.converters["Blob"](blob, {
context: "Argument 1",
prefix,
});
const url = core.opSync(
"op_file_create_object_url",
blob.type,
blob[_byteSequence],
);
return url;
}
function revokeObjectURL(url) {
const prefix = "Failed to execute 'revokeObjectURL' on 'URL'";
webidl.requiredArguments(arguments.length, 1, { prefix });
url = webidl.converters["DOMString"](url, {
context: "Argument 1",
prefix,
});
core.opSync(
"op_file_revoke_object_url",
url,
);
}
URL.createObjectURL = createObjectURL;
URL.revokeObjectURL = revokeObjectURL;
})(globalThis);