diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-06-10 15:26:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-10 15:26:10 +0200 |
commit | 6091ea098a86cafb38aed3228a64ad96a046c817 (patch) | |
tree | 1533eb7872db17abe2d88a8db32c4719d403ba4d /extensions/file/03_blob_url.js | |
parent | fb20a6af761c8eb61a046b4c70e28061923e36ca (diff) |
refactor: merge deno_file crate into deno_web (#10914)
This refactor makes it so there's one less crate to publish on each release.
Diffstat (limited to 'extensions/file/03_blob_url.js')
-rw-r--r-- | extensions/file/03_blob_url.js | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/extensions/file/03_blob_url.js b/extensions/file/03_blob_url.js deleted file mode 100644 index 2b5e16b55..000000000 --- a/extensions/file/03_blob_url.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. - -// @ts-check -/// <reference no-default-lib="true" /> -/// <reference path="../../core/lib.deno_core.d.ts" /> -/// <reference path="../webidl/internal.d.ts" /> -/// <reference path="../web/internal.d.ts" /> -/// <reference path="../web/lib.deno_web.d.ts" /> -/// <reference path="../url/internal.d.ts" /> -/// <reference path="../url/lib.deno_url.d.ts" /> -/// <reference path="./internal.d.ts" /> -/// <reference path="./lib.deno_file.d.ts" /> -/// <reference lib="esnext" /> -"use strict"; - -((window) => { - const core = Deno.core; - const webidl = window.__bootstrap.webidl; - const { _byteSequence } = window.__bootstrap.file; - const { URL } = window.__bootstrap.url; - - /** - * @param {Blob} blob - * @returns {string} - */ - 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; - } - - /** - * @param {string} url - * @returns {void} - */ - 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); |