aboutsummaryrefslogtreecommitdiff
path: root/dev/vm.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-07-31 12:30:31 -0400
committerGitHub <noreply@github.com>2021-07-31 12:30:31 -0400
commit00c5ae79833a641ccc5f7d31b6eea3e91db4cb71 (patch)
treee21cb14527e2bf6e74b36eeab75e994d52df37b6 /dev/vm.js
parent2d57d69b9ed3adf1241074f7eb29a588bec817a2 (diff)
DictionaryImporterMediaLoader (#1860)
* Rename param for consistency * Move media loading functionality into DictionaryImporterMediaLoader * Create test class for media loading * Remove unnecessary Blob/Image/URL functionality
Diffstat (limited to 'dev/vm.js')
-rw-r--r--dev/vm.js18
1 files changed, 2 insertions, 16 deletions
diff --git a/dev/vm.js b/dev/vm.js
index 363cc115..9db87cdf 100644
--- a/dev/vm.js
+++ b/dev/vm.js
@@ -116,7 +116,7 @@ function deepStrictEqual(actual, expected) {
}
-function createURLClass(urlMap) {
+function createURLClass() {
const BaseURL = URL;
const result = function URL(url) {
const u = new BaseURL(url);
@@ -133,23 +133,13 @@ function createURLClass(urlMap) {
this.searchParams = u.searchParams;
this.username = u.username;
};
- result.createObjectURL = (object) => {
- const id = crypto.randomBytes(16).toString('hex');
- const url = `blob:${id}`;
- urlMap.set(url, object);
- return url;
- };
- result.revokeObjectURL = (url) => {
- urlMap.delete(url);
- };
return result;
}
class VM {
constructor(context={}) {
- this._urlMap = new Map();
- context.URL = createURLClass(this._urlMap);
+ context.URL = createURLClass();
context.crypto = {
getRandomValues: (array) => {
const buffer = crypto.randomBytes(array.byteLength);
@@ -205,10 +195,6 @@ class VM {
return single ? results[0] : results;
}
-
- getUrlObject(url) {
- return this._urlMap.get(url);
- }
}