diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-09-17 17:35:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-17 17:35:05 +0200 |
commit | 3421f4dbbd5cabb3a0866ebb3b8aeae5b62730ef (patch) | |
tree | 106787cfe937a65d5bad736f266f6db8ce0eefb4 | |
parent | 303ebc0df4fc889d8c1d3bb4375eeb57aedfe3ce (diff) |
refactor: disable URL.createObjectUrl (#7543)
-rw-r--r-- | cli/rt/11_url.js | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/cli/rt/11_url.js b/cli/rt/11_url.js index e47f710c8..fee40ebcf 100644 --- a/cli/rt/11_url.js +++ b/cli/rt/11_url.js @@ -2,7 +2,6 @@ ((window) => { const core = window.Deno.core; - const { getRandomValues } = window.__bootstrap.crypto; const { customInspect } = window.__bootstrap.console; const { isIterable, requiredArguments } = window.__bootstrap.webUtil; @@ -385,14 +384,6 @@ return parts; } - // Based on https://github.com/kelektiv/node-uuid - // TODO(kevinkassimo): Use deno_std version once possible. - function generateUUID() { - return "00000000-0000-4000-8000-000000000000".replace(/[0]/g, () => - // random integer from 0 to 15 as a hex digit. - (getRandomValues(new Uint8Array(1))[0] % 16).toString(16)); - } - // Keep it outside of URL to avoid any attempts of access. const blobURLMap = new Map(); @@ -712,27 +703,12 @@ return this.href; } - // TODO(kevinkassimo): implement MediaSource version in the future. - static createObjectURL(blob) { - const origin = "http://deno-opaque-origin"; - const key = `blob:${origin}/${generateUUID()}`; - blobURLMap.set(key, blob); - return key; + static createObjectURL() { + throw new Error("Not implemented"); } - static revokeObjectURL(url) { - let urlObject; - try { - urlObject = new URL(url); - } catch { - throw new TypeError("Provided URL string is not valid"); - } - if (urlObject.protocol !== "blob:") { - return; - } - // Origin match check seems irrelevant for now, unless we implement - // persisten storage for per globalThis.location.origin at some point. - blobURLMap.delete(url); + static revokeObjectURL() { + throw new Error("Not implemented"); } } |