summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Guerreiro <maxime.guerreiro@gmail.com>2021-06-23 21:11:00 +0200
committerGitHub <noreply@github.com>2021-06-23 21:11:00 +0200
commitabd7a8a9cdc407169993c4282d45ec9f717c74bd (patch)
tree914df6c14c78e0fb700c8fe771557a073f2ee0a7
parentedab21ebab3daa3cb0ebd5f6fca60c17098df242 (diff)
docs(core): Use op name in example (#11094)
The first argument to opSync/opAsync is the op name. In the examples, the name is 'hello', and so it should be the first argument.
-rw-r--r--core/ops_json.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/ops_json.rs b/core/ops_json.rs
index 995f94885..07208a420 100644
--- a/core/ops_json.rs
+++ b/core/ops_json.rs
@@ -29,7 +29,7 @@ use std::rc::Rc;
///
/// ...it can be invoked from JS using the provided name, for example:
/// ```js
-/// let result = Deno.core.opSync("function_name", args);
+/// let result = Deno.core.opSync("hello", args);
/// ```
///
/// `runtime.sync_ops_cache()` must be called after registering new ops
@@ -68,7 +68,7 @@ where
///
/// ...it can be invoked from JS using the provided name, for example:
/// ```js
-/// let future = Deno.core.opAsync("function_name", args);
+/// let future = Deno.core.opAsync("hello", args);
/// ```
///
/// `runtime.sync_ops_cache()` must be called after registering new ops