diff options
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/06_util.js | 16 | ||||
-rw-r--r-- | runtime/js/13_buffer.js | 2 | ||||
-rw-r--r-- | runtime/js/40_process.js | 3 | ||||
-rw-r--r-- | runtime/js/40_testing.js | 4 | ||||
-rw-r--r-- | runtime/js/99_main.js | 3 |
5 files changed, 7 insertions, 21 deletions
diff --git a/runtime/js/06_util.js b/runtime/js/06_util.js index c643f758a..277e83ec5 100644 --- a/runtime/js/06_util.js +++ b/runtime/js/06_util.js @@ -4,7 +4,6 @@ ((window) => { const { decodeURIComponent, - Error, ObjectPrototypeIsPrototypeOf, Promise, SafeArrayIterator, @@ -34,19 +33,6 @@ } } - class AssertionError extends Error { - constructor(msg) { - super(msg); - this.name = "AssertionError"; - } - } - - function assert(cond, msg = "Assertion failed.") { - if (!cond) { - throw new AssertionError(msg); - } - } - function createResolvable() { let resolve; let reject; @@ -154,8 +140,6 @@ log, setLogDebug, createResolvable, - assert, - AssertionError, pathFromURL, writable, nonEnumerable, diff --git a/runtime/js/13_buffer.js b/runtime/js/13_buffer.js index d62092010..49d7a1cdd 100644 --- a/runtime/js/13_buffer.js +++ b/runtime/js/13_buffer.js @@ -6,7 +6,7 @@ "use strict"; ((window) => { - const { assert } = window.__bootstrap.util; + const { assert } = window.__bootstrap.infra; const { TypedArrayPrototypeSubarray, TypedArrayPrototypeSlice, diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js index 14c31fa8d..c33ce1c04 100644 --- a/runtime/js/40_process.js +++ b/runtime/js/40_process.js @@ -5,7 +5,8 @@ const core = window.Deno.core; const { FsFile } = window.__bootstrap.files; const { readAll } = window.__bootstrap.io; - const { assert, pathFromURL } = window.__bootstrap.util; + const { pathFromURL } = window.__bootstrap.util; + const { assert } = window.__bootstrap.infra; const { ArrayPrototypeMap, TypeError, diff --git a/runtime/js/40_testing.js b/runtime/js/40_testing.js index b79939f4b..2ec60ca44 100644 --- a/runtime/js/40_testing.js +++ b/runtime/js/40_testing.js @@ -6,7 +6,7 @@ const { setExitHandler } = window.__bootstrap.os; const { Console, inspectArgs } = window.__bootstrap.console; const { serializePermissions } = window.__bootstrap.permissions; - const { assert } = window.__bootstrap.util; + const { assert } = window.__bootstrap.infra; const { AggregateErrorPrototype, ArrayPrototypeFilter, @@ -82,7 +82,7 @@ "op_fdatasync_async": ["flush pending data operations for a file to disk", "awaiting the result of a `Deno.fdatasync` call"], "op_fetch_send": ["send a HTTP request", "awaiting the result of a `fetch` call"], "op_ffi_call_nonblocking": ["do a non blocking ffi call", "awaiting the returned promise"] , - "op_ffi_call_ptr_nonblocking": ["do a non blocking ffi call", "awaiting the returned promise"], + "op_ffi_call_ptr_nonblocking": ["do a non blocking ffi call", "awaiting the returned promise"], "op_flock_async": ["lock a file", "awaiting the result of a `Deno.flock` call"], "op_fs_events_poll": ["get the next file system event", "breaking out of a for await loop looping over `Deno.FsEvents`"], "op_fstat_async": ["get file metadata", "awaiting the result of a `Deno.File#fstat` call"], diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index a0f059603..3a37abeab 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -25,6 +25,7 @@ delete Object.prototype.__proto__; PromisePrototypeThen, TypeError, } = window.__bootstrap.primordials; + const infra = window.__bootstrap.infra; const util = window.__bootstrap.util; const eventTarget = window.__bootstrap.eventTarget; const globalInterfaces = window.__bootstrap.globalInterfaces; @@ -705,7 +706,7 @@ delete Object.prototype.__proto__; ObjectFreeze(globalThis.Deno.core); } else { delete globalThis.Deno; - util.assert(globalThis.Deno === undefined); + infra.assert(globalThis.Deno === undefined); } } |