mirror of
https://github.com/denoland/deno.git
synced 2024-11-23 15:16:54 -05:00
b657d743a2
- remove "CliState.workers" and "CliState.next_worker_id", instead store them on "OpState" using type aliases. - remove "CliState.global_timer" and "CliState.start_time", instead store them on "OpState" using type aliases. - remove "CliState.is_internal", instead pass it to Worker::new - move "CliState::permissions" to "OpState" - move "CliState::main_module" to "OpState" - move "CliState::global_state" to "OpState" - move "CliState::check_unstable()" to "GlobalState" - change "cli_state()" to "global_state()" - change "deno_core::ModuleLoader" trait to pass "OpState" to callbacks - rename "CliState" to "CliModuleLoader"
12 lines
431 B
Rust
12 lines
431 B
Rust
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
|
use crate::permissions::Permissions;
|
|
|
|
pub fn init(rt: &mut deno_core::JsRuntime) {
|
|
super::reg_json_async(rt, "op_fetch", deno_fetch::op_fetch::<Permissions>);
|
|
super::reg_json_async(rt, "op_fetch_read", deno_fetch::op_fetch_read);
|
|
super::reg_json_sync(
|
|
rt,
|
|
"op_create_http_client",
|
|
deno_fetch::op_create_http_client::<Permissions>,
|
|
);
|
|
}
|