diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-01-26 23:46:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 23:46:46 +0100 |
commit | 462ce14a78b4109143918878042b9f552083c82e (patch) | |
tree | 64c65d91557159efccb40117e340e7abbb08d75d /runtime/js | |
parent | d889f996577a6345d08c4ce71063be6d765fb5ec (diff) |
refactor: migrate extensions to virtual ops module (#22135)
First pass of migrating away from `Deno.core.ensureFastOps()`.
A few "tricky" ones have been left for a follow up.
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/06_util.js | 6 | ||||
-rw-r--r-- | runtime/js/10_permissions.js | 6 | ||||
-rw-r--r-- | runtime/js/11_workers.js | 6 | ||||
-rw-r--r-- | runtime/js/30_os.js | 10 | ||||
-rw-r--r-- | runtime/js/40_fs_events.js | 5 | ||||
-rw-r--r-- | runtime/js/40_http.js | 2 | ||||
-rw-r--r-- | runtime/js/40_process.js | 4 | ||||
-rw-r--r-- | runtime/js/40_signals.js | 6 | ||||
-rw-r--r-- | runtime/js/41_prompt.js | 4 | ||||
-rw-r--r-- | runtime/js/90_deno_ns.js | 4 |
10 files changed, 20 insertions, 33 deletions
diff --git a/runtime/js/06_util.js b/runtime/js/06_util.js index 64ec4ba9b..199f710bc 100644 --- a/runtime/js/06_util.js +++ b/runtime/js/06_util.js @@ -1,9 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { core, primordials } from "ext:core/mod.js"; -const { - op_bootstrap_log_level, -} = core.ensureFastOps(); +import { primordials } from "ext:core/mod.js"; +import { op_bootstrap_log_level } from "ext:core/ops"; const { Promise, SafeArrayIterator, diff --git a/runtime/js/10_permissions.js b/runtime/js/10_permissions.js index 19923a342..4e7d0d340 100644 --- a/runtime/js/10_permissions.js +++ b/runtime/js/10_permissions.js @@ -1,11 +1,11 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { core, primordials } from "ext:core/mod.js"; -const { +import { primordials } from "ext:core/mod.js"; +import { op_query_permission, op_request_permission, op_revoke_permission, -} = core.ensureFastOps(); +} from "ext:core/ops"; const { ArrayIsArray, ArrayPrototypeIncludes, diff --git a/runtime/js/11_workers.js b/runtime/js/11_workers.js index 774fd3434..0cfd0a0c8 100644 --- a/runtime/js/11_workers.js +++ b/runtime/js/11_workers.js @@ -1,13 +1,13 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { core, primordials } from "ext:core/mod.js"; -const { +import { primordials } from "ext:core/mod.js"; +import { op_create_worker, op_host_post_message, op_host_recv_ctrl, op_host_recv_message, op_host_terminate_worker, -} = core.ensureFastOps(); +} from "ext:core/ops"; const { ArrayPrototypeFilter, Error, diff --git a/runtime/js/30_os.js b/runtime/js/30_os.js index b35f34e1a..8948cf1ad 100644 --- a/runtime/js/30_os.js +++ b/runtime/js/30_os.js @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { core, primordials } from "ext:core/mod.js"; -const { +import { primordials } from "ext:core/mod.js"; +import { op_delete_env, op_env, op_exec_path, @@ -14,12 +14,10 @@ const { op_os_release, op_os_uptime, op_set_env, + op_set_exit_code, op_system_memory_info, op_uid, -} = core.ensureFastOps(); -const { - op_set_exit_code, -} = core.ensureFastOps(true); +} from "ext:core/ops"; const { Error, FunctionPrototypeBind, diff --git a/runtime/js/40_fs_events.js b/runtime/js/40_fs_events.js index 21d552111..9592b9f7d 100644 --- a/runtime/js/40_fs_events.js +++ b/runtime/js/40_fs_events.js @@ -1,15 +1,12 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, internals, primordials } from "ext:core/mod.js"; +import { op_fs_events_open, op_fs_events_poll } from "ext:core/ops"; const { BadResourcePrototype, InterruptedPrototype, } = core; const { - op_fs_events_open, - op_fs_events_poll, -} = core.ensureFastOps(); -const { ArrayIsArray, ObjectPrototypeIsPrototypeOf, PromiseResolve, diff --git a/runtime/js/40_http.js b/runtime/js/40_http.js index 2e932c968..675d428cd 100644 --- a/runtime/js/40_http.js +++ b/runtime/js/40_http.js @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, internals } from "ext:core/mod.js"; +import { op_http_start } from "ext:core/ops"; const { internalRidSymbol } = core; -const { op_http_start } = core.ensureFastOps(); import { HttpConn } from "ext:deno_http/01_http.js"; diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js index ea99bcd97..e6c865928 100644 --- a/runtime/js/40_process.js +++ b/runtime/js/40_process.js @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, internals, primordials } from "ext:core/mod.js"; -const { +import { op_kill, op_run, op_run_status, @@ -9,7 +9,7 @@ const { op_spawn_kill, op_spawn_sync, op_spawn_wait, -} = core.ensureFastOps(); +} from "ext:core/ops"; const { ArrayPrototypeMap, ArrayPrototypeSlice, diff --git a/runtime/js/40_signals.js b/runtime/js/40_signals.js index c654dd2dd..9d3cd4092 100644 --- a/runtime/js/40_signals.js +++ b/runtime/js/40_signals.js @@ -1,11 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, primordials } from "ext:core/mod.js"; -const { - op_signal_bind, - op_signal_poll, - op_signal_unbind, -} = core.ensureFastOps(); +import { op_signal_bind, op_signal_poll, op_signal_unbind } from "ext:core/ops"; const { SafeSet, SafeSetIterator, diff --git a/runtime/js/41_prompt.js b/runtime/js/41_prompt.js index d0e065538..8460862d2 100644 --- a/runtime/js/41_prompt.js +++ b/runtime/js/41_prompt.js @@ -1,8 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, primordials } from "ext:core/mod.js"; -const { - op_read_line_prompt, -} = core.ensureFastOps(); +import { op_read_line_prompt } from "ext:core/ops"; const { ArrayPrototypePush, StringPrototypeCharCodeAt, diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index 98cc9f14d..9f403e901 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -1,11 +1,11 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, internals } from "ext:core/mod.js"; -const { +import { op_net_listen_udp, op_net_listen_unixpacket, op_runtime_memory_usage, -} = core.ensureFastOps(); +} from "ext:core/ops"; import * as timers from "ext:deno_web/02_timers.js"; import * as httpClient from "ext:deno_fetch/22_http_client.js"; |