diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2024-02-06 22:28:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-06 22:28:32 +0100 |
commit | c8b2af8ed1b27822b0e6193b7a82903f54e56d95 (patch) | |
tree | 0ea57f0d038552971914d08b95e0dec5d93ef102 /runtime/js/06_util.js | |
parent | c6def993e052626be3933de4299bf4b2eb76e48a (diff) |
refactor: use web utils and lazy load utils from core (#22289)
Diffstat (limited to 'runtime/js/06_util.js')
-rw-r--r-- | runtime/js/06_util.js | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/runtime/js/06_util.js b/runtime/js/06_util.js index 199f710bc..bf71c371b 100644 --- a/runtime/js/06_util.js +++ b/runtime/js/06_util.js @@ -2,10 +2,7 @@ import { primordials } from "ext:core/mod.js"; import { op_bootstrap_log_level } from "ext:core/ops"; -const { - Promise, - SafeArrayIterator, -} = primordials; +const { SafeArrayIterator } = primordials; // WARNING: Keep this in sync with Rust (search for LogLevel) const LogLevel = { @@ -36,52 +33,4 @@ function log(...args) { } } -function createResolvable() { - let resolve; - let reject; - const promise = new Promise((res, rej) => { - resolve = res; - reject = rej; - }); - promise.resolve = resolve; - promise.reject = reject; - return promise; -} - -function writable(value) { - return { - value, - writable: true, - enumerable: true, - configurable: true, - }; -} - -function nonEnumerable(value) { - return { - value, - writable: true, - enumerable: false, - configurable: true, - }; -} - -function readOnly(value) { - return { - value, - enumerable: true, - writable: false, - configurable: true, - }; -} - -function getterOnly(getter) { - return { - get: getter, - set() {}, - enumerable: true, - configurable: true, - }; -} - -export { createResolvable, getterOnly, log, nonEnumerable, readOnly, writable }; +export { log }; |