summaryrefslogtreecommitdiff
path: root/core/examples
diff options
context:
space:
mode:
Diffstat (limited to 'core/examples')
-rw-r--r--core/examples/hello_world.rs4
-rw-r--r--core/examples/http_bench_json_ops.js2
-rw-r--r--core/examples/schedule_task.rs10
3 files changed, 8 insertions, 8 deletions
diff --git a/core/examples/hello_world.rs b/core/examples/hello_world.rs
index 13a47221d..9260cfe56 100644
--- a/core/examples/hello_world.rs
+++ b/core/examples/hello_world.rs
@@ -53,11 +53,11 @@ const arr = [1, 2, 3];
print("The sum of");
print(arr);
print("is");
-print(Deno.core.opSync('op_sum', arr));
+print(Deno.core.ops.op_sum(arr));
// And incorrect usage
try {
- print(Deno.core.opSync('op_sum', 0));
+ print(Deno.core.ops.op_sum(0));
} catch(e) {
print('Exception:');
print(e);
diff --git a/core/examples/http_bench_json_ops.js b/core/examples/http_bench_json_ops.js
index 5b16776f4..cea344987 100644
--- a/core/examples/http_bench_json_ops.js
+++ b/core/examples/http_bench_json_ops.js
@@ -11,7 +11,7 @@ const responseBuf = new Uint8Array(
/** Listens on 0.0.0.0:4500, returns rid. */
function listen() {
- return Deno.core.opSync("op_listen");
+ return Deno.core.ops.op_listen();
}
/** Accepts a connection, returns rid. */
diff --git a/core/examples/schedule_task.rs b/core/examples/schedule_task.rs
index bd4bcb028..475c2d9ad 100644
--- a/core/examples/schedule_task.rs
+++ b/core/examples/schedule_task.rs
@@ -52,11 +52,11 @@ fn main() {
let future = async move {
// Schedule 10 tasks.
js_runtime
- .execute_script(
- "<usage>",
- r#"for (let i = 1; i <= 10; i++) Deno.core.opSync("op_schedule_task", i);"#
- )
- .unwrap();
+ .execute_script(
+ "<usage>",
+ r#"for (let i = 1; i <= 10; i++) Deno.core.ops.op_schedule_task(i);"#,
+ )
+ .unwrap();
js_runtime.run_event_loop(false).await
};
runtime.block_on(future).unwrap();