diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-10-11 11:41:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-11 11:41:54 -0700 |
commit | 97d8498d46bbfb7bb16eeb3a69565d2aeda1e5aa (patch) | |
tree | cfe85f3afccda5c0f87cbb29b79e0eab8d9c0d97 /cli/ops/fetch.rs | |
parent | 04ed8d0531b7c2c308b28b742f5c332345d97065 (diff) |
Add init methods for each op module (#3087)
Diffstat (limited to 'cli/ops/fetch.rs')
-rw-r--r-- | cli/ops/fetch.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/ops/fetch.rs b/cli/ops/fetch.rs index f69065f1d..1d330ce41 100644 --- a/cli/ops/fetch.rs +++ b/cli/ops/fetch.rs @@ -1,6 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. use super::dispatch_json::{Deserialize, JsonOp, Value}; use crate::http_util::get_client; +use crate::ops::json_op; use crate::resources; use crate::state::ThreadSafeState; use deno::*; @@ -12,6 +13,10 @@ use hyper::rt::Future; use std; use std::convert::From; +pub fn init(i: &mut Isolate, s: &ThreadSafeState) { + i.register_op("fetch", s.core_op(json_op(s.stateful_op(op_fetch)))); +} + #[derive(Deserialize)] struct FetchArgs { method: Option<String>, |