summaryrefslogtreecommitdiff
path: root/runtime/ops/runtime.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-09-12 00:10:43 +0200
committerGitHub <noreply@github.com>2023-09-12 00:10:43 +0200
commitbdeb4bddbf5cabd04abe906388f5ebfe64a84c53 (patch)
treefd6aed583eac5108c4403ae424bc4246781bed0c /runtime/ops/runtime.rs
parentaaff69db3fd8cf70d1c031720e84874cb4a4d02c (diff)
refactor: rewrite runtime/ ops to op2 (#20459)
Diffstat (limited to 'runtime/ops/runtime.rs')
-rw-r--r--runtime/ops/runtime.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/ops/runtime.rs b/runtime/ops/runtime.rs
index 175f18599..5042ba486 100644
--- a/runtime/ops/runtime.rs
+++ b/runtime/ops/runtime.rs
@@ -2,7 +2,7 @@
use crate::permissions::PermissionsContainer;
use deno_core::error::AnyError;
-use deno_core::op;
+use deno_core::op2;
use deno_core::ModuleSpecifier;
use deno_core::OpState;
@@ -15,7 +15,8 @@ deno_core::extension!(
},
);
-#[op]
+#[op2]
+#[string]
fn op_main_module(state: &mut OpState) -> Result<String, AnyError> {
let main_url = state.borrow::<ModuleSpecifier>();
let main_path = main_url.to_string();
@@ -30,7 +31,8 @@ fn op_main_module(state: &mut OpState) -> Result<String, AnyError> {
/// This is an op instead of being done at initialization time because
/// it's expensive to retrieve the ppid on Windows.
-#[op]
+#[op2]
+#[bigint]
pub fn op_ppid() -> i64 {
#[cfg(windows)]
{