mirror of
https://github.com/denoland/deno.git
synced 2024-11-26 16:09:27 -05:00
966ce7de8a
This commit adds blob URL support. Blob URLs are stored in a process global storage, that can be accessed from all workers, and the module loader. Blob URLs can be created using `URL.createObjectURL` and revoked using `URL.revokeObjectURL`. This commit does not add support for `fetch`ing blob URLs. This will be added in a follow up commit.
13 lines
268 B
TypeScript
13 lines
268 B
TypeScript
const blob = new Blob(
|
|
['export const a = "a";\n\nexport enum A {\n A,\n B,\n C,\n}\n'],
|
|
{
|
|
type: "application/typescript",
|
|
},
|
|
);
|
|
const url = URL.createObjectURL(blob);
|
|
|
|
const a = await import(url);
|
|
|
|
console.log(a.a);
|
|
console.log(a.A);
|
|
console.log(a.A.A);
|